:root {
  --bg: #0c0e12;
  --bg-elevated: #12151c;
  --panel: #161a22;
  --panel-hover: #1a1f29;
  --text: #e8eaed;
  --muted: #8b919a;
  --accent: #4d8eff;
  --accent-dim: #3b7ae8;
  --accent-glow: rgba(77, 142, 255, 0.22);
  --border: #2a3140;
  --border-strong: #3d4658;
  --danger: #f87171;
  --success: #4ade80;
  --success-dim: #22c55e;
  --workspace-bg: #1a1d24;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

body {
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(77, 142, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(99, 102, 241, 0.06), transparent 45%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
  border-radius: 4px;
}
a:hover {
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

/* Hero */
.hero {
  margin-bottom: 1.5rem;
}

.hero__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.85rem;
}

.hero__lede {
  margin: 0 0 0.85rem;
  color: var(--text);
  max-width: 68ch;
  font-size: 1.02rem;
}

.hero__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 68ch;
}

/* Engine status banner */
.lo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.lo-banner--ok {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.25);
}

.lo-banner--bad {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.28);
}

.lo-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  flex-shrink: 0;
}

.lo-banner__dot--bad {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.lo-banner__text {
  flex: 1 1 12rem;
  color: var(--text);
}

.lo-banner__text code {
  font-size: 0.82em;
}

.lo-banner__hint {
  flex-basis: 100%;
  padding-left: 1.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.lo-banner--bad .lo-banner__text {
  color: #fecaca;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card__head {
  margin-bottom: 1.15rem;
}

.card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.card__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 52ch;
}

.section-label {
  margin: 1.35rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-copy {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 52ch;
}

.examples-block {
  margin-top: 1.35rem;
}

.examples-block .card__head {
  margin-bottom: 1rem;
}

.examples-intro {
  max-width: none;
}

.example-cols {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .example-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

.example-cols h3 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.example-cols ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.example-cols em {
  font-style: normal;
  color: var(--accent);
}

.grid {
  display: grid;
  gap: 1.35rem;
  margin-top: 0;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.row:last-child {
  margin-bottom: 0;
}

.row--tight {
  margin-top: 1.1rem;
}

.row--actions {
  margin-top: 1.25rem;
  align-items: center;
  gap: 0.65rem;
}

.download-wrap {
  display: inline-flex;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

select,
input[type="text"],
input[type="color"] {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.94rem;
  min-width: 11.5rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%238b919a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

select:hover,
input[type="color"]:hover {
  border-color: var(--border-strong);
}

select:focus-visible,
input[type="color"]:focus-visible,
input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field--color input[type="color"] {
  min-width: 3.25rem;
  height: 2.65rem;
  padding: 0.25rem;
  cursor: pointer;
}

.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-elevated);
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--accent);
  background: rgba(77, 142, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent-glow);
}

.dropzone:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.05);
}

.dropzone__icon {
  display: block;
  margin: 0 auto 0.85rem;
  color: var(--muted);
  opacity: 0.85;
  transition: color 0.2s ease, transform 0.2s ease;
}

.dropzone:hover .dropzone__icon,
.dropzone.drag .dropzone__icon {
  color: var(--accent);
  transform: translateY(-2px);
}

.dropzone__primary {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--text);
}

.dropzone__primary strong {
  font-weight: 650;
}

.dropzone__hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

.dropzone__hint-key {
  font-weight: 600;
  color: var(--text);
}

.dropzone__file {
  margin: 0.85rem 0 0;
  display: inline-block;
  max-width: 100%;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(77, 142, 255, 0.12);
  border: 1px solid rgba(77, 142, 255, 0.28);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  word-break: break-all;
}

.dropzone.has-file .dropzone__file {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.2rem;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn--primary {
  background: linear-gradient(165deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(77, 142, 255, 0.25);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--primary:active {
  transform: translateY(1px);
}

.btn--success {
  background: linear-gradient(165deg, #34d399 0%, var(--success-dim) 100%);
  color: #052e16;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.25);
}

.btn--success:hover {
  filter: brightness(1.05);
}

.btn--success:focus-visible {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.35);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.is-busy {
  cursor: wait;
  pointer-events: none;
}

.btn.is-busy .btn__label::after {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-left: 0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.workspace {
  min-height: 260px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--workspace-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: background-color 0.25s ease;
}

.workspace .hint {
  color: var(--muted);
  text-align: center;
  max-width: 34ch;
  margin: 0;
  font-size: 0.9rem;
}

.notice {
  font-size: 0.84rem;
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 0.85rem;
  margin-top: 1.15rem;
  background: rgba(77, 142, 255, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.status {
  margin-top: 1rem;
  min-height: 1.35em;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.status.loading {
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.status.error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.status.success {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.22);
}

.font-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.font-chips button {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.font-chips button:hover {
  border-color: var(--accent);
  background: rgba(77, 142, 255, 0.08);
}

.font-chips button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  margin-top: 0.25rem;
}

.checkbox input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.site-footer {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.84rem;
}

.site-footer__nav a {
  color: var(--muted);
}

.site-footer__nav a:hover {
  color: var(--text);
}
