:root {
  --bg-1: #05070d;
  --bg-2: #0b1322;
  --panel: rgba(10, 18, 34, 0.76);
  --panel-edge: rgba(73, 143, 255, 0.25);
  --text: #e9f1ff;
  --muted: #99a8c0;
  --blue: #2d7dff;
  --blue-soft: #69b0ff;
  --ok: #20c997;
  --warn: #ffb84d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #112749 0%, var(--bg-1) 45%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

.backdrop {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(88, 156, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 156, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9), transparent 88%);
  pointer-events: none;
}

.page {
  width: min(980px, calc(100% - 2rem));
  margin: 2.5rem auto 3rem;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: 1.4rem;
  animation: reveal 500ms ease;
}

.eyebrow {
  margin: 0;
  color: var(--blue-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}

h1 {
  margin: 0.3rem 0 0.5rem;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.subhead {
  margin: 0;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.35);
}

.input-panel {
  animation: reveal 700ms ease;
}

label {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.86rem;
  color: var(--muted);
}

textarea {
  width: 100%;
  border: 1px solid rgba(78, 133, 219, 0.5);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  resize: vertical;
  min-height: 105px;
  background: rgba(5, 12, 24, 0.95);
  color: var(--text);
  font: inherit;
}

textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(45, 125, 255, 0.2);
}

.action-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

button {
  border: none;
  border-radius: 11px;
  padding: 0.72rem 1.1rem;
  font: inherit;
  font-weight: 700;
  color: #061027;
  background: linear-gradient(125deg, #5aa2ff, #2d7dff);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(46, 126, 255, 0.3);
}

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

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

.result-panel {
  margin-top: 1rem;
  animation: reveal 360ms ease;
}

.hidden {
  display: none;
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.result-top h2 {
  margin: 0;
  font-size: 1.2rem;
}

.badge {
  border-radius: 999px;
  padding: 0.28rem 0.68rem;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(52, 124, 235, 0.2);
  border: 1px solid rgba(100, 164, 255, 0.4);
  color: #bad9ff;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric {
  border-radius: 12px;
  border: 1px solid rgba(85, 141, 231, 0.28);
  background: rgba(5, 11, 22, 0.85);
  padding: 0.85rem 0.9rem;
}

.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.metric h3 {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.score-card {
  background: linear-gradient(140deg, rgba(17, 48, 96, 0.66), rgba(9, 18, 35, 0.8));
  border-color: rgba(95, 155, 250, 0.55);
}

.score-card h3 {
  font-size: 1.45rem;
  color: #8ec2ff;
}

.explain-block,
.source-block {
  margin-top: 1rem;
  border-top: 1px solid rgba(76, 128, 211, 0.3);
  padding-top: 0.9rem;
}

h4 {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: #c8d9f5;
}

.explain-block p {
  margin: 0;
  color: #d8e5fa;
  line-height: 1.55;
}

.source-block ul {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

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

@media (max-width: 760px) {
  .page {
    margin-top: 1.2rem;
  }

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

  .action-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
