:root {
  --ink: #0b1020;
  --ocean: #0f2f2e;
  --sand: #f5f1e8;
  --clay: #f3c6a0;
  --accent: #ff8a3d;
  --mist: rgba(245, 241, 232, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Futura", "Gill Sans", "Trebuchet MS", sans-serif;
  color: var(--sand);
  background: radial-gradient(circle at 20% 10%, rgba(255, 138, 61, 0.2), transparent 45%),
    linear-gradient(120deg, #0b1020 10%, #0f2f2e 55%, #203a2f 100%);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.hero {
  margin-bottom: 32px;
}

.hero h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(2.5rem, 4vw, 3.6rem);
  letter-spacing: 0.02em;
  margin: 12px 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--clay);
}

.subhead {
  max-width: 640px;
  color: var(--mist);
  font-size: 1.1rem;
}

.panel {
  background: rgba(11, 16, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.panel-header h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.panel-header p {
  margin: 0 0 16px;
  color: var(--mist);
}

.upload {
  display: grid;
  gap: 16px;
}

.dropzone {
  padding: 32px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: rgba(15, 47, 46, 0.4);
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(255, 138, 61, 0.15);
}

.dropzone h3 {
  margin: 0 0 8px;
}

.dropzone p {
  margin: 0;
  color: var(--mist);
}

.link {
  color: var(--accent);
  font-weight: 600;
}

.file-name {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--clay);
}

.primary {
  background: var(--accent);
  color: #1b0f07;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  justify-self: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 25px rgba(255, 138, 61, 0.35);
}

.primary:hover {
  transform: translateY(-1px);
}

.error {
  color: #ffb4a8;
  min-height: 1.2rem;
}

.results {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.card {
  background: rgba(11, 16, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.card-header h2 {
  margin: 0 0 12px;
}

.content {
  white-space: pre-wrap;
  font-family: "JetBrains Mono", "SFMono-Regular", "Menlo", "Monaco", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--sand);
}

.muted {
  color: rgba(245, 241, 232, 0.6);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 32, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.is-active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: rgba(15, 47, 46, 0.95);
  padding: 28px 32px;
  border-radius: 16px;
  display: grid;
  gap: 16px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 18px;
  }

  .primary {
    width: 100%;
    justify-self: stretch;
  }
}
