:root {
  --bg: #0f172a;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-ink: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 1rem;
  background: radial-gradient(1200px 600px at 50% -10%, #1e293b, var(--bg));
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
}

.head {
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Single column by default; two columns on wider screens. */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .card {
    max-width: 780px;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.75rem;
    align-items: start;
    grid-template-areas:
      "field     preview"
      "dest      preview"
      "downloads preview";
  }

  .field { grid-area: field; }
  #destination { grid-area: dest; }
  .preview { grid-area: preview; }
  .downloads { grid-area: downloads; }
}

.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.preview {
  margin: 0;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
  padding: 1rem;
}

.preview svg,
.preview img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.destination {
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.destination a {
  display: inline-block;
  margin-top: 0.2rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.destination a:hover {
  text-decoration: underline;
}

.downloads {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fmt {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fmt-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

button {
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
}

button:hover:not(:disabled) { opacity: 0.9; }
button:active:not(:disabled) { transform: translateY(1px); }

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer {
  color: #cbd5e1;
  font-size: 0.8rem;
  text-align: center;
}

.footer a {
  color: #e2e8f0;
}
