:root {
  color-scheme: dark;
  --bg: #0d1110;
  --panel: #141a18;
  --panel-2: #1b2420;
  --line: #294139;
  --text: #edf7f0;
  --muted: #9fb4a8;
  --green: #57d86d;
  --green-2: #9cf2a4;
  --amber: #f0c66b;
  --blue: #75b8ff;
  --danger: #ff7777;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(87, 216, 109, 0.22);
  background: rgba(13, 17, 16, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
nav a,
.secondary-link {
  color: var(--text);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  font-size: 0.95rem;
}

nav a {
  color: var(--muted);
}

nav a:hover,
.secondary-link:hover {
  color: var(--green-2);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(340px, 1.14fr);
  gap: 28px;
  align-items: end;
  min-height: calc(100vh - 72px);
  padding: 42px 0 28px;
}

.hero-copy,
.generator-panel,
.file-list,
.preview-card,
.docs,
.steps {
  position: relative;
}

.logo-scene {
  position: relative;
  width: min(158px, 42vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 0 18px;
  isolation: isolate;
  animation: logoFloat 4.6s ease-in-out infinite;
}

.logo-scene::before {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(156, 242, 164, 0.2);
  background: rgba(7, 18, 12, 0.82);
  transform: rotate(4deg);
  z-index: -2;
}

.logo-scene::after {
  content: "";
  position: absolute;
  inset: 22% 12% 13% 18%;
  border: 1px solid rgba(117, 184, 255, 0.18);
  transform: rotate(-7deg);
  z-index: -3;
}

.hero-logo {
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter:
    drop-shadow(0 14px 18px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 18px rgba(87, 216, 109, 0.2));
}

.nametag {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%) rotate(-3deg);
  border: 2px solid #0b0f0d;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(45, 53, 49, 0.98), rgba(18, 24, 21, 0.98));
  box-shadow:
    0 0 0 1px #e9fff0,
    0 5px 0 #050806,
    0 10px 20px rgba(0, 0, 0, 0.35);
  color: #f4fff5;
  padding: 5px 12px 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(0.82rem, 2.3vw, 1.08rem);
  font-weight: 900;
  line-height: 1;
  text-shadow:
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000;
  animation: tagPulse 2.8s ease-in-out infinite;
}

.pixel-shadow {
  position: absolute;
  left: 19%;
  right: 19%;
  bottom: 12%;
  height: 12px;
  background: rgba(0, 0, 0, 0.32);
  filter: blur(8px);
  z-index: -1;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(156, 242, 164, 0.85);
  background: rgba(87, 216, 109, 0.78);
  box-shadow: 0 0 14px rgba(87, 216, 109, 0.58);
  opacity: 0;
  animation: particleRise 3.4s ease-in-out infinite;
}

.p1 { left: 6%; bottom: 24%; animation-delay: 0s; }
.p2 { left: 23%; bottom: 7%; animation-delay: 0.45s; }
.p3 { right: 12%; bottom: 22%; animation-delay: 0.9s; }
.p4 { right: 30%; top: 28%; animation-delay: 1.35s; }
.p5 { left: 31%; top: 18%; animation-delay: 1.8s; }
.p6 { right: 2%; top: 48%; animation-delay: 2.25s; }

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes tagPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes particleRise {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.65) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-42px) scale(1.1) rotate(90deg);
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

h1 {
  max-width: 590px;
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  color: var(--green-2);
}

.lead {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.08rem;
}

.generator-panel,
.preview-card,
.file-list,
.docs article,
.admin-panel,
.steps {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 26, 24, 0.9);
  box-shadow: var(--shadow);
}

.generator-panel {
  padding: 22px;
}

.panel-head,
.actions,
.tabs,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 20px;
}

.panel-head h2 {
  margin-bottom: 0;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input[type="text"],
input:not([type]),
select {
  width: 100%;
}

input,
select {
  min-width: 0;
  border: 1px solid #355047;
  border-radius: 6px;
  background: #0d1512;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--green-2) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--green-2) 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
    linear-gradient(180deg, #122019, #0a120f);
  border-color: #3a6653;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding-right: 42px;
  box-shadow:
    inset 0 0 0 1px rgba(156, 242, 164, 0.03),
    0 10px 24px rgba(0, 0, 0, 0.12);
}

select:hover {
  border-color: var(--green);
  background:
    linear-gradient(45deg, transparent 50%, #061009 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #061009 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
    linear-gradient(180deg, var(--green-2), var(--green));
  color: #061009;
}

select option {
  background: #0d1512;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(87, 216, 109, 0.15);
}

.toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.toggles label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid #2a3b35;
  border-radius: 6px;
  background: #111a16;
  padding: 10px;
  color: var(--text);
  font-weight: 650;
}

.primary,
.actions button,
.tab {
  border: 1px solid #3d5f52;
  border-radius: 6px;
  color: var(--text);
  background: #17231e;
  cursor: pointer;
}

.primary {
  border-color: transparent;
  background: var(--green);
  color: #061009;
  padding: 11px 15px;
  font-weight: 900;
}

.primary:hover {
  background: var(--green-2);
}

.actions button,
.tab {
  padding: 9px 12px;
}

.actions button:hover,
.tab:hover {
  border-color: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  padding: 28px 0;
}

.file-list {
  padding: 18px;
  align-self: start;
}

.file-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
}

.file-list li {
  border: 1px solid #283a34;
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  background: #101813;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.preview-card {
  min-width: 0;
  overflow: hidden;
}

.tabs {
  justify-content: flex-start;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.tab.active {
  border-color: var(--green);
  color: #08120b;
  background: var(--green-2);
  font-weight: 800;
}

pre {
  min-height: 460px;
  max-height: 620px;
  margin: 0;
  overflow: auto;
  padding: 20px;
  background: #080d0b;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  color: #cfe7d5;
}

.docs,
.admin-panel,
.steps {
  margin: 28px 0;
  padding: 26px;
}

.docs p,
.admin-panel p,
.steps p,
.steps li {
  color: var(--muted);
}

.docs-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 22px;
  align-items: end;
  margin-bottom: 22px;
}

.search-box {
  border: 1px solid #2d473d;
  border-radius: 8px;
  background: #101813;
  padding: 14px;
}

.search-box input {
  margin-top: 8px;
}

.docs-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
}

.docs-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  display: grid;
  gap: 8px;
  border: 1px solid #294139;
  border-radius: 8px;
  background: #101813;
  padding: 12px;
}

.docs-nav a {
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.docs-nav a:hover {
  background: #17231e;
  color: var(--green-2);
}

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

.doc-card {
  padding: 18px;
  box-shadow: none;
  background:
    linear-gradient(145deg, rgba(29, 42, 35, 0.96), rgba(12, 18, 15, 0.98));
  overflow: hidden;
}

.doc-card[hidden] {
  display: none;
}

.doc-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--green-2);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.doc-card pre {
  min-height: 0;
  max-height: none;
  margin-top: 14px;
  border: 1px solid #273a33;
  border-radius: 6px;
  padding: 12px;
}

.doc-card code {
  font-size: 0.8rem;
}

.empty-docs {
  margin: 18px 0 0;
  border: 1px solid #4c3b22;
  border-radius: 8px;
  background: rgba(240, 198, 107, 0.08);
  padding: 14px;
  color: var(--amber);
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-add {
  display: grid;
  grid-template-columns: minmax(190px, 0.6fr) minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid #294139;
  border-radius: 8px;
  background: #101813;
  padding: 14px;
}

.registry-status {
  border: 1px solid #294139;
  border-radius: 8px;
  background: #101813;
  color: var(--green-2);
  padding: 13px 14px;
  font-weight: 800;
}

.registry-status.registry-error {
  border-color: #5e3a3a;
  color: #ffb4b4;
  background: #231717;
}

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

.version-list {
  border: 1px solid #294139;
  border-radius: 8px;
  background: #101813;
  padding: 14px;
}

.version-list h3 {
  margin-bottom: 12px;
}

.version-list ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.version-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #263a33;
  border-radius: 6px;
  background: #0b120f;
  padding: 8px 9px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9rem;
}

.danger-button {
  border: 1px solid #5e3a3a;
  border-radius: 6px;
  background: #231717;
  color: #ffb4b4;
  cursor: pointer;
}

.danger-button {
  padding: 10px 12px;
  font-weight: 800;
}

.danger-button:hover {
  border-color: var(--danger);
  color: #fff;
}

.steps ol {
  display: grid;
  gap: 10px;
  padding-left: 24px;
  margin: 0 0 18px;
}

.note {
  border-left: 3px solid var(--amber);
  padding-left: 14px;
}

.secondary-link {
  display: inline-flex;
  border-bottom: 1px solid var(--green);
  color: var(--green-2);
  font-weight: 800;
}

.api-page {
  width: min(1240px, calc(100% - 32px));
}

.api-hero {
  padding: 76px 0 18px;
}

.api-toolbar {
  position: sticky;
  top: 61px;
  z-index: 8;
  margin: 0 0 18px;
  padding: 12px 0;
  background: rgba(13, 17, 16, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(87, 216, 109, 0.12);
}

.api-search {
  max-width: 680px;
}

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

.api-nav {
  position: static;
  top: auto;
}

.api-results {
  display: grid;
  gap: 16px;
}

.api-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(22, 31, 27, 0.96), rgba(10, 15, 13, 0.98));
  box-shadow: var(--shadow);
  padding: 22px;
}

.api-section[hidden] {
  display: none;
}

.api-section h2 {
  margin-bottom: 10px;
}

.api-section p,
.api-section li,
.api-section td {
  color: var(--muted);
}

.api-section ul {
  margin: 0;
  padding-left: 20px;
}

.api-section table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #273a33;
  border-radius: 8px;
}

.api-section th,
.api-section td {
  border-bottom: 1px solid #273a33;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.api-section th {
  color: var(--green-2);
  background: #101813;
}

.api-section tr:last-child td {
  border-bottom: 0;
}

.api-section pre {
  min-height: 0;
  max-height: none;
  margin-top: 16px;
  border: 1px solid #273a33;
  border-radius: 8px;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.signature-grid section {
  border: 1px solid #273a33;
  border-radius: 8px;
  background: #101813;
  padding: 14px;
}

footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 36px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

  .hero {
    align-items: start;
    min-height: auto;
  }

  .doc-results,
  .version-lists,
  .docs-head,
  .signature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-shell,
  .api-layout {
    grid-template-columns: 1fr;
  }

  .docs-nav,
  .api-nav {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar,
  nav,
  .panel-head,
  .admin-head,
  .actions,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .field-grid,
  .toggles,
  .admin-add,
  .version-lists,
  .doc-results,
  .docs-head,
  .docs-nav,
  .api-hero,
  .api-nav,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3rem;
  }
}
