:root {
  --accent: #0d9488;
  --accent-light: #ccfbf1;
  --accent-dark: #0f766e;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.25rem;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-light);
}

.nav p,
.step-title p,
.actions p,
footer {
  color: var(--muted);
}

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 20px 44px;
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.8rem;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 0.95;
  margin: 0 0 20px;
  letter-spacing: -0.06em;
}

h1 span {
  color: var(--accent);
}

.hero-text p {
  max-width: 520px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--muted);
}

.atom {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto;
}

.orbit,
.nucleus {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.orbit {
  width: 190px;
  height: 74px;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 50%;
}

.orbit-two {
  transform: translate(-50%, -50%) rotate(60deg);
}

.orbit-three {
  transform: translate(-50%, -50%) rotate(120deg);
}

.electron {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  animation: travel 2.8s linear infinite;
}

.orbit-two .electron {
  animation-duration: 3.5s;
}

.orbit-three .electron {
  animation-duration: 2.4s;
}

.nucleus {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 16px color-mix(in srgb, var(--accent) 12%, transparent);
}

@keyframes travel {
  from { transform: rotate(0deg) translateX(95px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(95px) rotate(-360deg); }
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.step,
.panel,
.result,
.quiz,
.error {
  margin-top: 28px;
}

.step-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.step-title span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  flex-shrink: 0;
}

.step-title h2,
.result-header h2,
.quiz h2 {
  margin: 0 0 4px;
}

.step-title p {
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.profile-card {
  text-align: left;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
  transition: 0.2s ease;
}

.profile-card:hover,
.profile-card.selected {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

.icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 1.35rem;
}

.teal { background: #ccfbf1; }
.amber { background: #fef3c7; }
.purple { background: #ede9fe; }

.profile-card h3 {
  margin: 0 0 8px;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.chips button {
  border: 1px solid var(--border);
  background: white;
  color: #374151;
  padding: 8px 12px;
  border-radius: 999px;
}

.chips button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  resize: vertical;
  outline: none;
  min-height: 130px;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.actions {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

#generateBtn {
  border: 0;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 800;
}

#generateBtn:hover:not(:disabled) {
  background: var(--accent-dark);
}

#generateBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel,
.result,
.quiz {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
}

.loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.loader span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 1.2s infinite ease-in-out;
}

.loader span:nth-child(2) { animation-delay: 0.2s; }
.loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.panel p {
  text-align: center;
  margin: 0;
  color: var(--muted);
}

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 18px;
  padding: 18px;
  font-weight: 700;
}

.result-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

#modeBadge {
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
}

#explanation {
  line-height: 1.8;
  color: #374151;
}

#explanation p {
  margin: 0 0 16px;
}

#explanation strong {
  color: var(--accent-dark);
}

.dyslexia-output {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 2.1 !important;
  letter-spacing: 0.02em;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quiz-option {
  text-align: left;
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.quiz-option.correct {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
  font-weight: 800;
}

.quiz-option.wrong {
  border-color: #dc2626;
  background: #fee2e2;
  color: #991b1b;
}

.feedback {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  font-weight: 800;
}

.feedback.good {
  background: #dcfce7;
  color: #166534;
}

.feedback.bad {
  background: #fee2e2;
  color: #991b1b;
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  background: white;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .cards,
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .nav p {
    display: none;
  }
}
