:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-alt: #fff7e3;
  --ink: #1b1b1f;
  --muted: #5c5c6a;
  --accent: #ff7a00;
  --accent-dark: #c85a00;
  --card: #ffffff;
  --stroke: rgba(27, 27, 31, 0.1);
  --shadow: 0 24px 60px rgba(27, 27, 31, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(circle at top, #fff1d6 0%, #f7f4ef 55%, #f1f3ff 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(27, 27, 31, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 27, 31, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 48px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.eyebrow {
  font-family: "Space Mono", monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.6rem, 3vw + 1.6rem, 4.2rem);
  margin-bottom: 12px;
}

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

.badge {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 18px 24px;
  text-align: center;
  min-width: 120px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}

.badge span {
  font-size: 0.85rem;
  color: var(--muted);
}

.badge strong {
  font-size: 2rem;
  color: var(--accent);
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: panelRise 0.6s ease both;
}

.panel-header h2 {
  font-size: 1.5rem;
}

.panel-header p {
  color: var(--muted);
  margin-top: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.label {
  font-size: 0.85rem;
  color: var(--muted);
}

.value {
  font-size: 1.6rem;
  font-weight: 600;
}

.typing-area {
  border: 1px dashed rgba(27, 27, 31, 0.2);
  border-radius: 20px;
  padding: 18px;
  background: #fffdf7;
  display: grid;
  gap: 16px;
}

textarea {
  width: 100%;
  min-height: 220px;
  border: none;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.6;
  font-family: "Space Mono", monospace;
  background: transparent;
  color: var(--ink);
}

textarea:focus {
  outline: none;
}

.typing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--muted);
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(255, 122, 0, 0.2);
}

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

button:active {
  transform: translateY(0);
}

.result {
  background: linear-gradient(135deg, #fffaf1 0%, #fff 60%);
}

.result-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.scorecard {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 14px;
  background: #fff;
}

.scorecard div {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.scorecard strong {
  color: var(--accent-dark);
}

#summary {
  color: var(--muted);
  line-height: 1.6;
}

.tipline {
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.95rem;
}

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

.chip {
  background: #1b1b1f;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.tips-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.tips-list li {
  padding: 12px 16px;
  background: #f7f5ff;
  border-radius: 14px;
  border: 1px solid rgba(27, 27, 31, 0.08);
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

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

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 600px) {
  .shell {
    padding: 32px 0 48px;
  }

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

  .typing-meta {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
