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

:root {
  --bg: #060609;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.085);
  --text: #f7f4ff;
  --muted: #9b98a8;
  --dim: #6f6b7d;
  --accent: #9b5cff;
  --accent-line: rgba(155, 92, 255, 0.32);
  --accent-muted: #bda2ee;
  --good: #80e6ae;
  --bad: #ff7d91;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(155, 92, 255, 0.035) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #08080c 0%, var(--bg) 46%, #050507 100%);
  background-size: 72px 72px, auto;
  color: var(--text);
  font-family: Lexend, Inter, Arial, sans-serif;
}

body.workspace-page {
  background:
    radial-gradient(ellipse 42% 28% at 18% 8%, rgba(155, 92, 255, 0.11), transparent 62%),
    linear-gradient(180deg, #08080d 0%, var(--bg) 360px);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(155, 92, 255, 0.052), transparent 34%);
  content: "";
  pointer-events: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.site-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(6, 6, 9, 0.76);
  backdrop-filter: blur(18px);
}

.workspace-page .site-header {
  position: sticky;
}

.navbar {
  display: flex;
  width: min(1220px, 100%);
  min-height: 70px;
  margin: auto;
  padding: 0 28px;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(155, 92, 255, 0.46));
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  display: inline-flex;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
}

.nav-links a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.045);
}

main {
  width: 100%;
}

section {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 88px 28px;
  scroll-margin-top: 72px;
}

.hero {
  display: grid;
  min-height: 100vh;
  padding-top: 126px;
  align-items: center;
  gap: 36px;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.7fr);
}

.hero-copy {
  max-width: 760px;
}

.kicker {
  margin-bottom: 18px;
  color: var(--accent-muted);
  font-size: 13px;
  font-weight: 500;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  color: white;
  font-size: clamp(56px, 8vw, 112px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0;
}

.hero p,
.section-title p,
.workspace-head p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-copy > p:not(.kicker) {
  max-width: 620px;
  font-size: 16px;
}

.hero-actions,
.toolbar-actions,
.editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn,
.icon-button {
  display: inline-flex;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.18s ease;
}

.btn {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
}

.btn-primary {
  background: #8f54ef;
}

.btn-primary:hover {
  background: #9b5cff;
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.btn-secondary:hover,
.icon-button:hover {
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.06);
}

.hero-actions {
  margin-top: 32px;
}

.hero-visual,
.feature-card,
.workspace-section,
.editor-panel,
.license-box,
.workspace-toolbar {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.hero-visual {
  padding: 16px;
}

.compare-frame {
  --split: 50%;
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #07070c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.compare-frame.large {
  min-height: 480px;
}

.compare-frame::before {
  position: absolute;
  z-index: 6;
  top: 0;
  right: 0;
  left: 0;
  height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.028);
  content: "";
  pointer-events: none;
}

.compare-code {
  position: absolute;
  inset: 0;
  min-width: 0;
  overflow: hidden;
}

.compare-original {
  z-index: 1;
  background: #080810;
}

.compare-obfuscated {
  z-index: 2;
  width: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(7, 7, 10, 0.96);
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.compare-label {
  position: absolute;
  z-index: 7;
  top: 13px;
  left: 16px;
  color: #d8d3e8;
  font-size: 11px;
  font-weight: 500;
}

.compare-obfuscated .compare-label {
  color: #f3edff;
}

.compare-handle {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: var(--split);
  width: 2px;
  background: rgba(155, 92, 255, 0.78);
  box-shadow: 0 0 24px rgba(155, 92, 255, 0.42);
  transform: translateX(-1px);
}

.compare-frame[style*="--split: 0%"] .compare-handle {
  left: 0;
}

.compare-frame[style*="--split: 100%"] .compare-handle {
  left: 100%;
}

.compare-handle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  place-items: center;
  color: white;
  background: #151019;
  content: "";
  font-size: 10px;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.compare-handle::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border: solid #d8c3ff;
  border-width: 0 1px 1px 0;
  content: "";
  transform: translate(-50%, -50%) rotate(-45deg);
}

.compare-range {
  position: absolute;
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

pre {
  min-height: 100%;
  width: 100%;
  padding: 58px 20px 20px;
  color: #d8c3ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.75;
  overflow: hidden;
  white-space: pre;
}

.compare-original pre {
  color: #f3efff;
}

.compare-obfuscated pre {
  color: #bda2ee;
}

.compare-code::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 72px;
  background: linear-gradient(180deg, transparent, rgba(7, 7, 12, 0.96));
  content: "";
  pointer-events: none;
}

.section-title {
  max-width: 620px;
  margin-bottom: 28px;
}

.section-title h2,
.workspace-head h2 {
  margin-bottom: 9px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
}

.feature-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--border);
  grid-template-columns: repeat(3, 1fr);
}

.feature-card {
  min-height: 190px;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: rgba(9, 9, 13, 0.94);
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 600;
}

.feature-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

.feature-card code {
  display: block;
  margin-top: 18px;
  color: #cbb5ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.workspace-section {
  padding: 22px;
}

.workspace-section.standalone {
  width: min(1240px, calc(100vw - 32px));
  margin-top: 0;
  margin-bottom: 0;
  padding: 22px 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.workspace-head {
  display: flex;
  margin-bottom: 14px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.workspace-head h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1;
}

.license-box {
  display: grid;
  min-width: min(440px, 100%);
  padding: 10px;
  align-items: end;
  gap: 10px;
  border-radius: 8px;
  grid-template-columns: 1fr auto;
  background: rgba(18, 18, 26, 0.82);
}

label {
  display: grid;
  gap: 8px;
  color: #d8c3ff;
  font-size: 12px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  color: white;
  background: rgba(255, 255, 255, 0.04);
}

input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.09);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.workspace-toolbar {
  display: flex;
  min-height: 52px;
  margin: 0 0 12px;
  padding: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 8px;
  background: rgba(18, 18, 26, 0.74);
}

.workspace-status {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

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

.status.bad {
  color: var(--bad);
}

.usage-meter {
  display: inline-flex;
  min-height: 32px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.usage-meter strong {
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.btn input {
  display: none;
}

.workspace {
  display: grid;
  min-height: calc(100vh - 236px);
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.editor-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 8px;
  background: #090910;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.editor-head {
  display: flex;
  width: 100%;
  margin: 0;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #111119;
}

.editor-head p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.editor-head h3 {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 700;
}

.editor-head span {
  color: var(--dim);
  font-size: 12px;
}

.monaco-host {
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  background: #090910;
}

.workspace-page .monaco-host {
  min-height: 0;
}

.monaco-host .monaco-editor,
.monaco-host .overflow-guard {
  width: 100% !important;
  height: 100% !important;
}

.modal {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 10, 15, 0.98);
}

.modal-card h2 {
  margin-bottom: 9px;
  font-size: 22px;
}

.modal-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  margin-top: 18px;
  justify-content: flex-end;
  gap: 10px;
}

.toast,
.tooltip {
  position: fixed;
  z-index: 3000;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  background: rgba(8, 8, 12, 0.98);
}

.toast {
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 13px 15px;
}

.tooltip {
  max-width: 220px;
  padding: 7px 9px;
  font-size: 11px;
  pointer-events: none;
}

@media (max-width: 980px) {
  .hero,
  .feature-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .workspace-head,
  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .usage-meter {
    padding-left: 0;
    border-left: 0;
  }

  .toolbar-actions,
  .btn {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .navbar,
  section {
    padding-inline: 16px;
  }

  .nav-links {
    display: none;
  }

  .workspace-section {
    padding: 14px;
  }

  .workspace-section.standalone {
    width: min(100vw - 20px, 760px);
    margin-top: 0;
  }

  .license-box {
    grid-template-columns: 1fr;
  }
}
