@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Manrope:wght@400;500;700;800&display=swap");

:root {
  --bg-deep: #111316;
  --bg-mid: #1d2228;
  --bg-soft: #2a3139;
  --panel: rgba(20, 24, 29, 0.86);
  --panel-edge: rgba(255, 255, 255, 0.16);
  --ink: #f5f7f9;
  --ink-muted: #b3bcc6;
  --accent: #ffc96a;
  --accent-strong: #ff7f32;
  --good: #8de7c4;
  --danger: #ff8a7c;
  --shadow: 0 28px 58px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 10%, rgba(255, 201, 106, 0.2), transparent 42%),
    radial-gradient(ellipse at 88% 88%, rgba(255, 127, 50, 0.2), transparent 45%),
    linear-gradient(145deg, var(--bg-deep), var(--bg-mid) 56%, var(--bg-soft));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(transparent 96%, rgba(255, 255, 255, 0.04) 100%),
    linear-gradient(90deg, transparent 96%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 1320px;
  margin: 24px auto 38px;
  padding: 0 18px;
}

.panel {
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 520ms cubic-bezier(0.2, 0.9, 0.1, 1) forwards;
}

.panel:nth-child(2) {
  animation-delay: 160ms;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: #fff7eb;
}

.subtitle {
  margin-top: 12px;
  margin-bottom: 18px;
  color: var(--ink-muted);
  max-width: 74ch;
  font-size: 0.95rem;
}

label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dfe5ec;
}

input[type="url"],
input[type="file"],
input[type="text"],
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.09);
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.mt {
  margin-top: 12px;
}

.source-switch,
.toolbar,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.source-block {
  margin: 14px 0;
}

.hidden {
  display: none;
}

.hint {
  margin-top: 9px;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.38);
}

.chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #28190a;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.actions button,
.toolbar > button:not(.chip) {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #20140a;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transition: transform 160ms ease, filter 160ms ease;
}

.actions button:hover,
.toolbar > button:not(.chip):hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.status {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.05);
  color: var(--good);
  font-size: 0.92rem;
}

.stats {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.output {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(9, 12, 15, 0.7);
  color: #eff4fa;
  border-radius: 14px;
  padding: 15px;
  min-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.52;
  font-size: 0.93rem;
}

@media (max-width: 1020px) {
  .shell {
    grid-template-columns: 1fr;
    margin: 14px auto 28px;
  }

  .output {
    min-height: 430px;
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.1rem;
  }
}
