:root {
  color-scheme: dark;
  --bg: #020617;
  --ink: #07111f;
  --navy: #0b132b;
  --paper: rgba(15, 23, 42, 0.82);
  --panel: rgba(2, 6, 23, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --line-bright: rgba(59, 130, 246, 0.58);
  --text: #ffffff;
  --muted: #cbd5e1;
  --muted-2: #64748b;
  --accent: #3b82f6;
  --accent-2: #7dd3fc;
  --gold: #f97316;
  --amber: #fbbf24;
  --shadow: 0 0 34px rgba(59, 130, 246, 0.2), 0 28px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at 76% 10%, rgba(59, 130, 246, 0.28), transparent 28rem),
    radial-gradient(circle at 12% 8%, rgba(125, 211, 252, 0.14), transparent 24rem),
    radial-gradient(circle at 18% 80%, rgba(249, 115, 22, 0.12), transparent 22rem),
    linear-gradient(90deg, rgba(125, 211, 252, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(125, 211, 252, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--bg) 0%, var(--ink) 48%, #020617 100%);
  background-size: auto, auto, auto, 44px 44px, 44px 44px, auto;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family:
    Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

.shell {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
  padding: 28px 0 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding: 8px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: min(280px, 64vw);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 24px rgba(59, 130, 246, 0.26));
}

.topbar p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: right;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 48px;
  align-items: end;
  padding: 64px 0 42px;
  text-align: left;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 33px;
  margin: 0 0 20px;
  padding: 7px 16px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(125, 211, 252, 0.1);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6ee7b7;
  box-shadow: 0 0 18px rgba(110, 231, 183, 0.8);
}

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

h1 {
  max-width: 880px;
  margin: 0 0 18px;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.65rem, 7vw, 4.85rem);
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy > p:last-child {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-card {
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.9)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-card p {
  margin-bottom: 16px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-card li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--muted);
  font-weight: 700;
}

.hero-card li span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 50%;
  color: var(--amber);
  background: rgba(249, 115, 22, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.workflow-strip article {
  position: relative;
  min-height: 128px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.84), rgba(2, 6, 23, 0.84));
  backdrop-filter: blur(16px);
}

.workflow-strip span,
.workflow-strip small,
.option small,
details small,
.rel-box p {
  color: var(--muted);
}

.workflow-strip span {
  display: block;
  margin-bottom: 9px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.workflow-strip strong {
  display: block;
  margin-bottom: 8px;
  line-height: 1.25;
}

.workflow-strip small {
  display: block;
  line-height: 1.45;
}

.generator {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}

.options-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: stretch;
  gap: 14px;
}

.options-panel > div:first-child {
  grid-column: auto;
  padding: 12px 4px;
}

.options-panel > div:first-child p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.input-panel {
  grid-column: span 8;
}

.output-panel {
  grid-column: 9 / -1;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.86)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(18px);
}

.panel h2 {
  margin-bottom: 5px;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
}

.panel p {
  color: var(--muted);
  line-height: 1.5;
}

.input-panel > p,
.options-panel > p {
  margin-bottom: 16px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title h2,
.panel-title p {
  margin-bottom: 5px;
}

textarea,
input,
select {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.76);
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

textarea {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  resize: vertical;
  line-height: 1.55;
}

#spintaxOutput {
  min-height: 200px;
}

.help {
  min-height: 106px;
  margin: 16px 0 12px;
  font-size: 0.9rem;
}

.output-help {
  min-height: auto;
  margin-bottom: 0;
}

code {
  padding: 2px 6px;
  border: 1px solid rgba(31, 111, 255, 0.16);
  border-radius: 6px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  white-space: nowrap;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.counter span {
  color: var(--text);
  font-weight: 800;
}

.option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: 14px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.option.boxed {
  display: flex;
  min-height: 116px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
}

.option strong,
.option small {
  display: block;
}

.option small {
  margin-top: 5px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.option input,
.option select {
  margin-top: auto;
}

input[type="number"],
select {
  height: 38px;
  padding: 0 11px;
}

select {
  min-width: 128px;
  color: #f8fafc;
  background-color: #020617;
}

select option {
  color: #020617;
  background: #ffffff;
}

input[type="number"] {
  width: 74px;
}

.option input[type="checkbox"] {
  width: 46px;
  height: 26px;
  appearance: none;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.28);
}

.option input[type="checkbox"]::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.option input[type="checkbox"]:checked {
  background: rgba(59, 130, 246, 0.3);
}

.option input[type="checkbox"]:checked::before {
  transform: translateX(20px);
  background: var(--accent);
}

.rel-box {
  min-height: 116px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.rel-box legend {
  font-weight: 700;
}

.rel-box p {
  margin: 8px 0 12px;
  font-size: 0.78rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 41px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.chip input {
  width: 16px;
  height: 16px;
  margin: 0;
  appearance: auto;
  accent-color: var(--accent);
}

details {
  margin: 10px 0 18px;
}

summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 48px;
  padding: 11px 0;
  color: var(--muted);
  cursor: pointer;
}

summary span {
  color: var(--text);
  font-weight: 700;
}

details textarea {
  min-height: 130px;
  margin-top: 10px;
}

.primary,
.secondary,
.style-toggle button,
.footer button,
.footer a {
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  color: var(--text);
  background: rgba(59, 130, 246, 0.1);
  cursor: pointer;
}

.primary {
  width: 100%;
  min-height: 44px;
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  font-weight: 800;
  box-shadow: 0 0 28px rgba(59, 130, 246, 0.3);
}

.secondary {
  min-width: 129px;
  min-height: 36px;
  padding: 0 14px;
}

.secondary:disabled {
  color: var(--muted-2);
  border-color: rgba(31, 111, 255, 0.12);
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.04);
}

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

.panel-head h2 {
  margin: 0;
}

.style-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.style-toggle button {
  min-height: 28px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.style-toggle button.is-active {
  color: #020617;
  background: var(--accent);
}

.preview {
  min-height: 200px;
  padding: 18px;
  border: 1px solid rgba(31, 111, 255, 0.14);
  border-radius: 8px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.68);
  overflow-wrap: anywhere;
}

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

.preview.minimal {
  background: transparent;
}

.preview h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.preview a {
  display: inline-flex;
  margin: 0 10px 10px 0;
  padding: 7px 10px;
  border: 1px solid rgba(31, 111, 255, 0.2);
  border-radius: 7px;
  color: var(--accent-2);
}

.preview.minimal a {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
}

.footer {
  margin-top: 64px;
  color: var(--muted);
  text-align: center;
}

.footer nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 36px 0 22px;
}

.footer a,
.footer button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  font-weight: 800;
}

.footer a svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.footer a[aria-label="YouTube"] svg path:last-child {
  fill: var(--bg);
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 28px, 1280px);
  }

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

  .topbar p {
    max-width: none;
    text-align: left;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 42px;
    text-align: left;
  }

  .workflow-strip,
  .generator,
  .options-panel {
    grid-template-columns: 1fr;
  }

  .input-panel,
  .output-panel {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .options-panel > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.45rem;
  }

  .panel {
    padding: 18px;
  }

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

  .footer nav {
    flex-wrap: wrap;
  }
}
