:root {
  --bg: #f4f1ea;
  --bg-ink: #1c1a17;
  --bg-card: #ffffff;
  --accent: #2c6e8f;
  --accent-2: #c5a46b;
  --muted: #5c5751;
  --border: #e0dad1;
  --shadow: 0 20px 60px rgba(28, 26, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--bg-ink);
  background: radial-gradient(circle at top, #faf7f2 0%, #f4f1ea 50%, #efe8dc 100%);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(44, 110, 143, 0.2), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(197, 164, 107, 0.25), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(44, 110, 143, 0.12), transparent 55%);
  pointer-events: none;
  animation: glow 12s ease-in-out infinite;
}

@keyframes glow {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

.app {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.hero {
  display: flex;
  gap: 32px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

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

.hero h1 {
  font-family: "Newsreader", serif;
  font-size: clamp(2.2rem, 3vw, 3.4rem);
  margin: 0 0 12px;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0;
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 16px;
  min-width: 220px;
}

.hero-metric {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hero-metric span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.hero-metric p {
  margin: 0;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(300px, 1fr);
  gap: 24px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease both;
}

.panel:nth-child(2) {
  animation-delay: 0.1s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.subtle {
  color: var(--muted);
  margin: 0 0 20px;
}

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.field span {
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
  background: #faf9f7;
  color: var(--bg-ink);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(44, 110, 143, 0.3);
  border-color: var(--accent);
}

.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(44, 110, 143, 0.25);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.output-panel textarea {
  min-height: 360px;
  font-family: "Newsreader", serif;
  font-size: 1rem;
  line-height: 1.5;
}

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

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

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.status {
  margin-top: 12px;
  font-size: 0.9rem;
  min-height: 20px;
}

.docx-wrapper {
  position: relative;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #fbf9f5;
  min-height: 360px;
}

.docx-preview {
  width: 100%;
  min-height: 440px;
  background: #fff;
  padding: 18px;
  overflow: auto;
}

.docx-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  background: repeating-linear-gradient(
    135deg,
    rgba(44, 110, 143, 0.08),
    rgba(44, 110, 143, 0.08) 12px,
    transparent 12px,
    transparent 24px
  );
}

.hidden {
  display: none;
}

.status.success {
  color: #1a6f3b;
}

.status.error {
  color: #a32929;
}

@media (max-width: 960px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-card {
    width: 100%;
  }

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