:root {
  --bg: #1b1d24;
  --bg-soft: #20232d;
  --panel: #252937;
  --panel-2: #20232d;
  --panel-3: #1d2028;
  --stroke: #363b4a;
  --stroke-2: #404557;

  --text: #f5f3f8;
  --muted: #b8bcc8;
  --muted-2: #8f94a3;

  --accent: #ab92ff;
  --accent-blue: #4b8dff;
  --accent-blue-2: #5c6cff;
  --soft-lilac: #b6afe7;
  --soft-lilac-2: #bdb6ea;

  --success-text: #8fc7a3;
  --success-border: #355846;
  --success-bg-top: rgba(42, 58, 47, 0.32);

  --error-text: #d1a1a1;
  --error-border: #5a3d43;
  --error-bg-top: rgba(66, 42, 47, 0.28);

  --mentor-bubble: #2a2f3d;
  --typing-bubble: #2f3650;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top center, rgba(64, 84, 160, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 120px;
}

.section {
  margin-top: 96px;
}

.intro {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: 72px;
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 920px;
}

h2 {
  margin: 0;
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.lesson-topic {
  margin-top: 20px;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: linear-gradient(180deg, #232734, #1d2028);
}

.lesson-topic__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lesson-topic__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.lead,
.section-text,
.scene-outcome,
.feedback-text,
.feedback-note,
.mentor-section__text {
  font-size: 28px;
  line-height: 1.5;
  color: var(--muted);
}

.lead {
  max-width: 980px;
  margin-top: 28px;
}

.lead--secondary {
  margin-top: 16px;
}

strong {
  color: var(--text);
  font-weight: 700;
}

/* Story card */

.story-card {
  background: linear-gradient(180deg, var(--soft-lilac), var(--soft-lilac-2));
  color: #202231;
  border-radius: 32px;
  padding: 30px;
  overflow: hidden;
}

.story-card__top {
  margin-bottom: 28px;
}

.story-card__label {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

.story-card__title {
  margin: 0;
  width: 100%;
  font-size: 50px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #202231;
  max-width: none;
}

.story-card__middle {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
  align-items: stretch;
}

.story-card__image-wrap {
  min-height: 100%;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border: 1px solid rgba(32, 34, 49, 0.08);
}

.story-card__image {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
}

.story-points {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 16px;
}

.story-point {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(32, 34, 49, 0.14);
  border-radius: 20px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-point__title {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #222334;
}

.story-point p {
  margin: 0;
  font-size: 22px;
  line-height: 1.4;
  color: #2b2d3e;
}

.story-card__bottom {
  margin-top: 26px;
}

.story-card__caption {
  margin: 0;
  width: 100%;
  font-size: 28px;
  line-height: 1.45;
  color: rgba(32, 34, 49, 0.9);
  max-width: none;
}

/* Chat */

.chat-block__header {
  margin-bottom: 24px;
}

.chat-block__eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-block__title {
  margin: 0;
}

.chat-frame {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(42, 47, 61, 0.72), rgba(28, 31, 40, 0.96));
  padding: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.02),
    0 18px 40px rgba(6, 8, 14, 0.18);
}

.chat-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.chat-meta {
  margin-bottom: 24px;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
}

.chat-row--you {
  justify-content: flex-end;
}

.chat-row--team,
.chat-row--mentor {
  justify-content: flex-start;
}

.chat-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 86px;
  flex: 0 0 86px;
}

.chat-person--you {
  order: 2;
}

.avatar {
  border-radius: 999px;
}

.avatar--chat {
  width: 68px;
  height: 68px;
  object-fit: cover;
  flex: 0 0 68px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  background: #2a2f3d;
  padding: 8px;
}

.chat-person__name {
  font-size: 14px;
  line-height: 1.2;
  color: var(--muted-2);
  text-align: center;
  word-break: normal;
  overflow-wrap: anywhere;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: min(78%, 760px);
}

.chat-row--you .message {
  align-items: flex-end;
}

.message__bubble {
  position: relative;
  padding: 18px 22px;
  border-radius: 22px;
  font-size: 22px;
  line-height: 1.48;
  border: 1px solid transparent;
  width: fit-content;
  max-width: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.message__bubble:hover {
  transform: translateY(-1px);
}

.message--you .message__bubble {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-2));
  color: white;
  border-bottom-right-radius: 8px;
  box-shadow: 0 14px 30px rgba(52, 101, 255, 0.22);
}

.message--team .message__bubble {
  background: #181a21;
  color: var(--text);
  border: 1px solid #232735;
  border-bottom-left-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.message--mentor .message__bubble {
  background: var(--mentor-bubble);
  color: var(--text);
  border: 1px solid #3c4253;
  border-bottom-left-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

/* Typing bubble */

.message--typing .message__bubble {
  background: var(--typing-bubble);
  color: #dfe5ff;
  border: 1px solid #465072;
  border-bottom-right-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.typing-label {
  font-size: 18px;
  line-height: 1;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #dfe5ff;
  opacity: 0.35;
  animation: typingBlink 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBlink {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.scene-outcome {
  max-width: 900px;
  margin: 24px 0 0;
}

/* Mentor section */

.mentor-section__intro {
  max-width: 950px;
  margin-bottom: 28px;
}

.mentor-section__eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mentor-section__title {
  margin: 0 0 18px;
}

.mentor-section__text {
  margin: 0;
}

/* Decision */

.decision-hint {
  margin: 14px 0 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

.answer-card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  align-items: start;
  text-align: left;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.answer-card:hover {
  transform: translateY(-2px);
  border-color: #5d6480;
  background: #232735;
  box-shadow: 0 16px 28px rgba(10, 12, 18, 0.16);
}

.answer-card.is-selected {
  border-color: var(--accent);
  background: #262b3a;
}

.answer-index {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.06em;
  padding-top: 4px;
}

.answer-copy {
  font-size: 28px;
  line-height: 1.4;
}

/* Feedback */

.feedback {
  margin-top: 32px;
  padding: 24px 24px 24px 28px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: var(--panel-3);
  position: relative;
}

.feedback::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
  background: #5b6070;
}

.feedback-status {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feedback-text {
  margin: 0;
}

.feedback-note {
  margin: 18px 0 0;
  color: var(--text);
}

.feedback--success {
  background: linear-gradient(180deg, var(--success-bg-top), rgba(29, 32, 40, 1));
  border-color: var(--success-border);
}

.feedback--success::before {
  background: var(--success-text);
}

.feedback--success .feedback-status {
  color: var(--success-text);
}

.feedback--error {
  background: linear-gradient(180deg, var(--error-bg-top), rgba(29, 32, 40, 1));
  border-color: var(--error-border);
}

.feedback--error::before {
  background: var(--error-text);
}

.feedback--error .feedback-status {
  color: var(--error-text);
}

.hidden {
  display: none;
}

/* Lesson navigation */

.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.lesson-nav--single {
  justify-content: flex-end;
}

.lesson-nav__link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.lesson-nav__link:hover {
  transform: translateY(2px);
  opacity: 0.95;
}

.lesson-nav__link--prev {
  align-items: center;
}

.lesson-nav__link--next {
  align-items: center;
}

.lesson-nav__label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lesson-nav__icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #232734, #1d2028);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.lesson-nav__svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Entrance animations */

.reveal,
.reveal-on-show {
  opacity: 0;
  transform: translateY(10px);
  animation: chatAppear 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--delay, 0s);
}

.reveal-on-show {
  animation-play-state: paused;
}

.is-animating .reveal-on-show {
  animation-play-state: running;
}

@keyframes chatAppear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive */

@media (max-width: 980px) {
  .page {
    padding: 28px 20px 100px;
  }

  .section {
    margin-top: 76px;
  }

  h1 {
    font-size: 56px;
  }

  h2 {
    font-size: 36px;
  }

  .lesson-topic__title {
    font-size: 20px;
  }

  .lead,
  .section-text,
  .scene-outcome,
  .feedback-text,
  .feedback-note,
  .mentor-section__text,
  .answer-copy,
  .story-card__caption {
    font-size: 22px;
  }

  .story-card__title {
    font-size: 38px;
  }

  .story-card__middle {
    grid-template-columns: 1fr;
  }

  .story-card__image-wrap {
    min-height: 280px;
  }

  .story-points {
    grid-template-rows: auto;
  }

  .story-point p {
    font-size: 20px;
  }

  .message {
    max-width: 86%;
  }

  .message__bubble {
    font-size: 20px;
  }

  .answer-card {
    grid-template-columns: 48px 1fr;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 30px;
  }

  .lesson-topic {
    width: 100%;
  }

  .lesson-topic__title {
    font-size: 18px;
  }

  .lead,
  .section-text,
  .scene-outcome,
  .feedback-text,
  .feedback-note,
  .mentor-section__text,
  .answer-copy,
  .story-card__caption,
  .decision-hint {
    font-size: 19px;
  }

  .story-card {
    padding: 22px;
    border-radius: 24px;
  }

  .story-card__title {
    font-size: 30px;
  }

  .story-point p {
    font-size: 18px;
  }

  .message__bubble {
    padding: 16px 18px;
    border-radius: 20px;
    font-size: 18px;
  }

  .typing-label {
    font-size: 16px;
  }

  .chat-person {
    width: 62px;
    flex-basis: 62px;
    gap: 6px;
  }

  .avatar--chat {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    padding: 6px;
  }

  .chat-person__name,
  .answer-index,
  .feedback-status,
  .eyebrow,
  .story-card__label,
  .chat-block__eyebrow,
  .mentor-section__eyebrow,
  .chat-meta,
  .lesson-nav__label,
  .lesson-topic__label {
    font-size: 12px;
  }

  .chat-thread {
    gap: 14px;
  }

  .message {
    max-width: 100%;
  }

  .chat-frame {
    padding: 18px;
    border-radius: 24px;
  }

  .answer-card {
    padding: 18px;
    border-radius: 18px;
  }

  .feedback {
    padding: 18px 18px 18px 22px;
    border-radius: 18px;
  }

  .lesson-nav__icon {
    width: 50px;
    height: 50px;
  }
}