* {
  box-sizing: border-box;
}

:root {
  --bg: #050507;
  --card: rgba(15, 15, 25, 0.75);
  --text: #f5f7ff;
  --muted: #9296aa;
  --border: rgba(120, 110, 255, 0.25);
  --code: #090a12;
  --primary: #7c3cff;
  --cyan: #00e5ff;
  --pink: #ff4fd8;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(124, 60, 255, 0.35),
      transparent 450px
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(0, 229, 255, 0.15),
      transparent 350px
    ),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(circle, black, transparent 70%);
}

main {
  width: min(900px, calc(100% - 40px));
  margin: auto;
}

header {
  padding: 80px 0 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(124, 60, 255, 0.5);
}

h1 {
  margin: 0;
  font-size: 3.5rem;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin: 70px 0 20px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

h3 {
  margin-top: 0;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.lead {
  font-size: 1.3rem;
  max-width: 700px;
  margin-top: 30px;
}

.playground {
  display: flex;
  gap: 20px;
  margin-top: 35px;
  align-items: stretch;
}

form,
.result {
  flex: 1;
  min-width: 0;
}

form {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: 18px;
  box-shadow:
    0 0 40px rgba(124, 60, 255, 0.12),
    inset 0 0 40px rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

form h2 {
  margin: 0;
  font-size: 1.4rem;
}

input[type="text"],
textarea,
input[type="file"] {
  width: 100%;
  font: inherit;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

textarea {
  height: 120px;
  resize: none;
}

fieldset {
  padding: 0;
  margin: 0;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

label {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
}

label:hover {
  color: white;
}

label:has(input:checked) {
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: white;
}

input[type="radio"] {
  position: absolute;
  opacity: 0;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #7c3cff, #00e5ff);
  color: white;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(124, 60, 255, 0.35);
}

button:hover {
  filter: brightness(1.15);
}

.text input[type="file"],
.json input[type="file"],
.file textarea {
  display: none;
}

.file input[type="file"] {
  display: block;
  margin-bottom: 70px;
}

.result {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(0, 229, 255, 0.05), rgba(124, 60, 255, 0.08)),
    var(--code);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow: auto;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
}

section {
  border-top: 1px solid var(--border);
  padding-bottom: 20px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 16px;
}

.card:hover {
  border-color: rgba(0, 229, 255, 0.5);
}

pre {
  background: #05060b;
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

footer {
  padding: 70px 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .playground {
    flex-direction: column;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

.value-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--border);
}

.value-types > div {
  background: var(--card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.value-types strong {
  color: #00e5ff;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.value-types code {
  font-size: 1.2rem;
}

.value-types span {
  color: var(--muted);
}

.result img {
  max-width: 100%;
}
