:root {
  --surface: #0e0e0e;
  --surface-dim: #131313;
  --surface-low: #1a1919;
  --surface-high: #201f1f;
  --surface-highest: #262626;
  --surface-bright: #2c2c2c;
  --surface-variant: rgba(38, 38, 38, 0.62);
  --text: #ffffff;
  --text-soft: #e5e2e1;
  --text-dim: #adaaaa;
  --line: rgba(119, 117, 117, 0.16);
  --primary: #ba9eff;
  --primary-dim: #8455ef;
  --primary-ink: #39008c;
  --tertiary: #47c4ff;
  --shadow: rgba(57, 0, 140, 0.16);
  --shadow-deep: rgba(0, 0, 0, 0.45);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --container: 1240px;
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(132, 85, 239, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(71, 196, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #090909 0%, #0e0e0e 100%);
}

img {
  display: block;
  max-width: 100%;
}

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

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

button {
  cursor: pointer;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #070707;
  color: var(--text-soft);
  padding: 15px 16px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(186, 158, 255, 0.35);
  box-shadow: 0 0 0 4px rgba(132, 85, 239, 0.12);
}

.page-shell {
  position: relative;
  overflow-x: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 140px 140px;
  opacity: 0.12;
  pointer-events: none;
}

.ambient {
  position: fixed;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.3;
  pointer-events: none;
}

.ambient-violet {
  top: -12rem;
  left: -10rem;
  background: rgba(132, 85, 239, 0.36);
}

.ambient-cyan {
  right: -12rem;
  bottom: -12rem;
  background: rgba(71, 196, 255, 0.2);
}

.topbar,
.site-footer,
.hero,
.section-grid,
.blueprint-strip,
.blueprint-main {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 12px;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: white;
  font-family: "Geist", sans-serif;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  box-shadow: 0 16px 40px rgba(57, 0, 140, 0.24);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong,
.wordmark {
  font-family: "Geist", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-copy small {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topnav a,
.site-footer a,
.link-button {
  color: var(--text-dim);
  transition: color var(--transition);
}

.topnav a:hover,
.site-footer a:hover,
.link-button:hover {
  color: var(--text);
}

main {
  padding-bottom: 64px;
}

.hero {
  display: grid;
  gap: 28px;
  padding: 52px 0 36px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 460px);
  align-items: center;
}

.hero-copy h1,
.blueprint-hero h1 {
  max-width: 12ch;
  margin: 0 0 18px;
  font-family: "Geist", sans-serif;
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.lead,
.feature-panel p,
.blueprint-copy p,
.blueprint-card p {
  max-width: 60ch;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

.eyebrow,
.field-label,
.ghost-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-actions,
.blueprint-actions,
.modal-actions,
.modal-actions-split {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 18px;
  font-weight: 700;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    color var(--transition);
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button-primary {
  color: var(--primary-ink);
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  box-shadow: 0 20px 44px rgba(57, 0, 140, 0.24);
}

.button-secondary,
.button-ghost {
  color: var(--text-soft);
  background: rgba(38, 38, 38, 0.7);
}

.button-ghost {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(119, 117, 117, 0.16);
}

.button-block {
  width: 100%;
}

.button-compact {
  min-height: 40px;
  padding-inline: 16px;
}

.panel {
  position: relative;
  background: rgba(24, 24, 24, 0.92);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.glass-panel {
  background: rgba(38, 38, 38, 0.58);
  backdrop-filter: blur(28px);
}

.panel-glow {
  position: absolute;
  inset: auto 12% 82% auto;
  width: 160px;
  height: 160px;
  background: rgba(186, 158, 255, 0.22);
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.auth-shell {
  padding: 34px;
  overflow: hidden;
}

.auth-brand {
  margin-bottom: 26px;
  text-align: center;
}

.auth-brand h2 {
  margin: 0 0 8px;
  font-family: "Geist", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

.auth-brand p,
.auth-legal {
  margin: 0;
  color: var(--text-dim);
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: fit-content;
  gap: 6px;
  padding: 6px;
  margin: 0 auto 22px;
  border-radius: var(--radius-pill);
  background: #050505;
}

.auth-tab,
.segmented-control button,
.ratio-grid button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 14px;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.auth-tab {
  min-width: 108px;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 700;
}

.auth-tab.is-active,
.segmented-control button.is-active,
.ratio-grid button.is-active {
  color: var(--text);
  background: var(--surface-bright);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-form,
.field-group,
.download-list {
  display: grid;
  gap: 16px;
}

.auth-form label span,
.field-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-meta a {
  color: var(--primary);
}

.divider {
  position: relative;
  margin: 22px 0;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--line);
}

.divider span {
  position: relative;
  padding: 0 14px;
  background: rgba(38, 38, 38, 0.92);
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.hero-stats,
.section-grid,
.card-grid {
  display: grid;
  gap: 18px;
}

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

.metric-card,
.feature-panel,
.blueprint-card {
  padding: 22px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(38, 38, 38, 0.94) 0%, rgba(26, 25, 25, 0.92) 100%);
}

.metric-card strong,
.feature-panel h3,
.blueprint-card h3,
.blueprint-strip h3,
.blueprint-links h3 {
  display: block;
  margin-bottom: 10px;
  font-family: "Geist", sans-serif;
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.metric-card span {
  color: var(--text-dim);
  line-height: 1.6;
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 0 28px;
}

.blueprint-strip,
.blueprint-links,
.blueprint-hero {
  display: grid;
  gap: 24px;
  padding: 28px;
}

.blueprint-strip,
.blueprint-hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: center;
}

.diagram-frame {
  display: block;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.diagram-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 40px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.sidebar {
  position: fixed;
  inset: 18px auto 18px 18px;
  width: 264px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: rgba(19, 19, 19, 0.9);
  backdrop-filter: blur(18px);
}

.sidebar-create {
  margin-top: 8px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav a {
  padding: 15px 16px;
  color: var(--text-dim);
  border-radius: 16px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.sidebar-nav a.is-active,
.sidebar-nav a:hover {
  color: var(--text);
  background: rgba(38, 38, 38, 0.88);
}

.storage-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 20px;
  background: rgba(38, 38, 38, 0.62);
}

.storage-bar {
  height: 8px;
  margin: 14px 0 10px;
  border-radius: 999px;
  background: #060606;
  overflow: hidden;
}

.storage-bar span,
.modal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
}

.storage-bar span {
  width: 72%;
}

.storage-card small,
.download-item span,
.modal small {
  color: var(--text-dim);
}

.studio-shell {
  padding: 18px 18px 18px 300px;
}

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.wordmark {
  font-size: clamp(1.7rem, 4vw, 2.25rem);
  font-style: italic;
}

.studio-top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  background: rgba(38, 38, 38, 0.8);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.api-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.api-badge-pending {
  color: var(--text-soft);
  background: rgba(44, 44, 44, 0.76);
}

.api-badge-online {
  color: #06263a;
  background: rgba(71, 196, 255, 0.86);
}

.api-badge-offline {
  color: #2e0711;
  background: rgba(255, 110, 132, 0.88);
}

.studio-main {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.control-panel {
  padding: 24px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: #090909;
}

.segmented-control button,
.ratio-grid button {
  min-height: 44px;
  padding: 0 14px;
  font-weight: 700;
}

.upload-card {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 24px 18px;
  border-radius: 18px;
  background: #070707;
  border: 1px dashed rgba(119, 117, 117, 0.24);
  text-align: center;
}

.upload-card strong {
  color: var(--text-soft);
}

.upload-card span {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.job-status-card,
.preview-caption {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(7, 7, 7, 0.7);
}

.job-status-card strong,
.preview-caption strong {
  font-family: "Geist", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.job-status-card span,
.preview-caption p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.6;
}

.job-status-card.is-online {
  box-shadow: inset 0 0 0 1px rgba(71, 196, 255, 0.18);
}

.job-status-card.is-error {
  box-shadow: inset 0 0 0 1px rgba(255, 110, 132, 0.22);
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-stage {
  display: grid;
  gap: 20px;
}

.preview-card {
  padding: 24px;
}

.preview-head,
.history-head,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-head {
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(71, 196, 255, 0.8);
  box-shadow: 0 0 18px rgba(71, 196, 255, 0.5);
}

.artifact-shell {
  position: relative;
  min-height: 620px;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 25%, rgba(132, 85, 239, 0.24), transparent 30%),
    linear-gradient(180deg, rgba(11, 12, 24, 0.95) 0%, rgba(18, 9, 22, 0.98) 100%);
}

.artifact-shell.has-asset {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.artifact-shell.has-asset .artifact-core {
  opacity: 0.22;
}

.preview-caption {
  margin-top: 18px;
}

.artifact-square::after {
  content: "";
  position: absolute;
  inset: auto 18% 9% 18%;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 65, 214, 0.34), rgba(0, 0, 0, 0));
  filter: blur(20px);
}

.artifact-core {
  position: absolute;
  inset: 12% 12% 16% 12%;
  border-radius: 44% 56% 48% 52% / 42% 46% 54% 58%;
  background:
    radial-gradient(circle at 35% 30%, rgba(120, 231, 255, 0.82), rgba(69, 131, 180, 0.25) 28%, transparent 42%),
    linear-gradient(145deg, #15263b 0%, #1b1130 42%, #09080d 100%);
  box-shadow:
    inset -12px -24px 40px rgba(0, 0, 0, 0.55),
    inset 10px 10px 36px rgba(126, 196, 240, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.34);
  transform: rotate(8deg);
}

.artifact-ribbon {
  position: absolute;
  inset: 12%;
  border: 6px solid rgba(255, 255, 255, 0.03);
  border-radius: 48% 52% 38% 62% / 46% 42% 58% 54%;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 14px rgba(255, 68, 214, 0.34));
}

.ribbon-a {
  inset: 10% 8% 16% 10%;
  border-color: rgba(255, 38, 204, 0.8);
}

.ribbon-b {
  inset: 18% 14% 22% 14%;
  border-color: rgba(105, 211, 255, 0.55);
  transform: rotate(18deg);
}

.ribbon-c {
  inset: 22% 18% 28% 18%;
  border-color: rgba(238, 103, 255, 0.56);
  transform: rotate(-14deg);
}

.history-panel {
  padding: 0 8px;
}

.history-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.history-thumb {
  position: relative;
  min-height: 74px;
  border: 1px solid transparent;
  border-radius: 18px;
  background:
    radial-gradient(circle at 35% 30%, rgba(132, 85, 239, 0.4), transparent 32%),
    linear-gradient(145deg, #19131d 0%, #100f17 100%);
}

.history-thumb.is-active {
  border-color: rgba(186, 158, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(132, 85, 239, 0.12);
}

.history-thumb.is-muted {
  opacity: 0.38;
}

.history-add {
  color: var(--text-dim);
  font-size: 1.8rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  width: min(calc(100% - 32px), 680px);
  padding: 28px;
  border-radius: 32px;
  transform: translate(-50%, -50%);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.45);
}

.modal-head h2,
.modal-success h2 {
  margin: 0 0 8px;
  font-family: "Geist", sans-serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: -0.04em;
}

.modal-head p,
.modal-success p {
  margin: 0;
  color: var(--text-dim);
}

.modal-head strong {
  color: var(--primary);
  font-family: "Geist", sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

.modal-progress {
  height: 12px;
  margin: 28px 0 24px;
  background: #080808;
  border-radius: 999px;
  overflow: hidden;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(19, 19, 19, 0.78);
}

.download-item strong {
  display: block;
  margin-bottom: 6px;
}

.download-item em {
  font-style: normal;
  color: var(--text-dim);
}

.download-item.is-complete em {
  color: var(--tertiary);
}

.download-item.is-active {
  background: rgba(44, 44, 44, 0.92);
}

.modal-actions {
  margin-top: 24px;
}

.modal-success {
  width: min(calc(100% - 32px), 560px);
  text-align: center;
}

.modal-success .download-list,
.modal-success .modal-actions {
  margin-top: 24px;
}

.modal-actions-split {
  justify-content: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 28px;
  color: var(--primary-ink);
  font-family: "Geist", sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dim));
  box-shadow: 0 0 48px rgba(186, 158, 255, 0.26);
}

.blueprint-main {
  display: grid;
  gap: 22px;
  padding: 44px 0 64px;
}

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

.blueprint-links {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.blueprint-actions {
  justify-content: flex-end;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero-grid,
  .blueprint-strip,
  .blueprint-hero,
  .section-grid,
  .card-grid,
  .blueprint-links,
  .studio-main {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .blueprint-hero h1 {
    max-width: 16ch;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    margin: 18px;
  }

  .studio-shell {
    padding: 0 18px 18px;
  }

  .artifact-shell {
    min-height: 500px;
  }

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

@media (max-width: 720px) {
  .topbar,
  .site-footer,
  .hero,
  .section-grid,
  .blueprint-strip,
  .blueprint-main {
    width: min(calc(100% - 28px), var(--container));
  }

  .topbar,
  .site-footer,
  .hero-actions,
  .blueprint-actions,
  .modal-actions-split,
  .auth-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .topnav,
  .site-footer div {
    justify-content: center;
    flex-wrap: wrap;
  }

  .auth-shell,
  .preview-card,
  .control-panel,
  .blueprint-strip,
  .blueprint-hero,
  .blueprint-links,
  .modal {
    padding: 22px;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }

  .artifact-shell {
    min-height: 380px;
  }

  .history-strip {
    gap: 10px;
  }

  .history-thumb {
    min-height: 58px;
  }
}
