:root {
  color-scheme: light;
  --bg: #f4efe8;
  --bg-accent: #fdfbf7;
  --ink: #221f1c;
  --muted: #6b645c;
  --primary: #0f6d4a;
  --primary-dark: #0b5036;
  --accent: #ef7f3c;
  --card: #ffffff;
  --shadow: 0 12px 40px rgba(34, 31, 28, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Georgia", "Garamond", "Times New Roman", serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7ec 0%, var(--bg) 65%);
}

code {
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

.page {
  min-height: 100vh;
  padding: 48px 6vw 72px;
  background-image: radial-gradient(circle at 10% 20%,
      rgba(239, 127, 60, 0.16),
      transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(15, 109, 74, 0.18), transparent 45%);
}

.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.nav-link {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(34, 31, 28, 0.16);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.92rem;
}

.nav-link:hover {
  border-color: var(--primary);
}

.nav-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 16px;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  margin: 0 0 16px;
}

.subhead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 45ch;
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.file-drop {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 2px dashed rgba(34, 31, 28, 0.2);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-drop input {
  display: none;
}

.file-drop:hover {
  border-color: var(--primary);
  background: rgba(15, 109, 74, 0.08);
}

.file-title {
  font-weight: 600;
}

.field-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid rgba(34, 31, 28, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.text-input:focus,
.text-area:focus {
  outline: 2px solid rgba(15, 109, 74, 0.25);
  border-color: var(--primary);
}

.file-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.ghost-btn {
  border: 1px solid rgba(34, 31, 28, 0.2);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.divider {
  border: 0;
  border-top: 1px solid rgba(34, 31, 28, 0.15);
  margin: 20px 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}

.card h3 {
  margin-top: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(239, 127, 60, 0.16);
  font-size: 0.85rem;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(34, 31, 28, 0.04);
}

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

.error {
  background: rgba(239, 127, 60, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border-left: 3px solid #ef7f3c;
}

.warning {
  background: rgba(255, 193, 7, 0.2);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  border-left: 3px solid #ffc107;
  color: #856404;
}

.json-section {
  margin-top: 32px;
  animation: rise 0.5s ease both;
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.json-controls {
  display: flex;
  gap: 8px;
}

.json-container {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: 600px;
}

.json-output {
  margin: 0;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  background: rgba(34, 31, 28, 0.04);
  padding: 16px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }

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

@media (max-width: 640px) {
  .page {
    padding: 32px 6vw 56px;
  }

  .hero-card {
    padding: 20px;
  }
}
