:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #0f1a2b;
  --muted: #5b6777;
  --brose: #e4002b;
  --accent: #0a3456;
  --shadow: 0 24px 60px rgba(15, 26, 43, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffffff, var(--bg));
  min-height: 100vh;
}

.ambient span {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(228, 0, 43, 0.14), transparent 45%);
  pointer-events: none;
  z-index: -1;
}

.ambient span:nth-child(2) {
  background: radial-gradient(circle at 85% 15%, rgba(10, 52, 86, 0.15), transparent 40%);
}

.ambient span:nth-child(3) {
  background: radial-gradient(circle at 50% 80%, rgba(15, 26, 43, 0.08), transparent 45%);
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
}

.brand img {
  width: clamp(120px, 18vw, 160px);
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.75rem;
  color: var(--brose);
  font-weight: 600;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.subline {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

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

form {
  display: grid;
  gap: 24px;
}

.dropzone {
  border: 2px dashed rgba(10, 52, 86, 0.25);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: linear-gradient(135deg, rgba(228, 0, 43, 0.05), rgba(10, 52, 86, 0.04));
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brose);
  background: linear-gradient(135deg, rgba(228, 0, 43, 0.12), rgba(10, 52, 86, 0.06));
}

.dropzone input {
  display: none;
}

.dropzone h2 {
  margin: 0;
  font-size: 1.25rem;
}

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

#fileName {
  display: inline-flex;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 500;
}

.prompt {
  display: grid;
  gap: 8px;
}

.prompt span {
  font-weight: 600;
}

textarea {
  border-radius: 16px;
  border: 1px solid rgba(15, 26, 43, 0.15);
  padding: 16px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: rgba(228, 0, 43, 0.6);
  box-shadow: 0 0 0 4px rgba(228, 0, 43, 0.1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

button {
  border: none;
  background: var(--brose);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 24px rgba(228, 0, 43, 0.2);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.status {
  font-size: 0.95rem;
  color: var(--muted);
}

footer {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

footer code {
  background: rgba(10, 52, 86, 0.08);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--accent);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px;
  max-width: 640px;
  width: min(92vw, 640px);
  box-shadow: var(--shadow);
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  animation: modal-out 0.2s ease forwards;
}

.modal.open .modal-card {
  animation: modal-in 0.35s ease forwards;
}

.modal-card h2 {
  margin: 12px 0 6px;
  font-size: 1.5rem;
}

.modal-card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.modal-card .markdown-body {
  background: rgba(10, 52, 86, 0.08);
  border-radius: 16px;
  padding: 16px;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  font-size: 0.95rem;
  white-space: pre-wrap;
  max-height: 280px;
  overflow: auto;
  color: var(--accent);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 0 0 12px;
}

.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body ul {
  margin: 0 0 12px 18px;
  padding: 0;
}

.markdown-body li {
  margin: 4px 0;
}

.modal-close {
  border: none;
  background: rgba(10, 52, 86, 0.1);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

@keyframes modal-in {
  0% {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes modal-out {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }
}

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

  .card {
    padding: 24px;
  }
}
