:root {
  --haseeb: #ffd21f;
  --haseeb-deep: #f5b800;
  --haseeb-edge: #b07d00;
  --ink: #1b1722;
  --muted: #5b5566;
  --paper: #fff8f0;
  --surface: #ffffff;
  --peach: #ffe9d6;
  --peach-deep: #ffd2ad;
  --line: #f3d9c0;
  --sunset: #ff8a4c;
  --sky: #cfeaf7;
  --sky-soft: #eaf6fc;
  --teal: #0b7f8c;
  --teal-ink: #076571;
  --teal-soft: #d8f1f4;
  --plum: #5b4a6e;
  --success-bg: #e3f7ea;
  --success-ink: #0f5e3a;
  --oops-bg: #fff0e0;
  --oops-ink: #7a3b08;
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 12px 30px rgba(120, 70, 20, 0.12);
  --shadow-soft: 0 6px 16px rgba(120, 70, 20, 0.1);
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--teal);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 210, 31, 0.28) 0, rgba(255, 210, 31, 0) 28rem),
    radial-gradient(circle at 0% 8%, rgba(207, 234, 247, 0.9) 0, rgba(207, 234, 247, 0) 26rem),
    var(--paper);
  color: var(--ink);
  font-family: Cairo, Tajawal, Tahoma, Arial, sans-serif;
  line-height: 1.6;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

a {
  color: var(--teal-ink);
}

.icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

html[dir="rtl"] .icon-dir {
  transform: scaleX(-1);
}

.haseeb-inline {
  display: inline-block;
  width: 2.2em;
  height: 1.8em;
  flex: none;
  vertical-align: middle;
}

.site-header,
main,
footer {
  width: min(1440px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 22px 0 18px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 64px;
  height: 56px;
  flex: none;
  padding: 4px 6px 0;
  border-radius: 20px;
  background: linear-gradient(160deg, #ffe3c8, #ffc99d);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  display: block;
  margin: 0 0 2px;
  color: var(--teal-ink);
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.32rem, 3vw, 1.9rem);
  line-height: 1.3;
}

h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
  line-height: 1.5;
}

.brand-title {
  display: block;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.3;
}

.wordmark {
  position: relative;
  display: inline-block;
  font-size: clamp(1.6rem, 3.4vw, 2.05rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
}

.wordmark::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0.02em;
  z-index: -1;
  height: 0.32em;
  border-radius: 999px;
  background: var(--haseeb);
}

.site-nav,
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav {
  justify-self: center;
}

.site-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 999px;
  padding-inline: 14px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--peach);
}

.status-chip {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-demo {
  background: var(--peach);
  color: var(--oops-ink);
}

.status-ready {
  background: var(--teal-soft);
  color: var(--teal-ink);
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.button-primary {
  background: var(--haseeb);
  box-shadow: 0 4px 0 var(--haseeb-edge), 0 8px 16px rgba(176, 125, 0, 0.25);
  color: var(--ink);
}

.button-primary:hover:not(:disabled) {
  background: #ffdd4a;
}

.button-secondary {
  border-color: var(--peach-deep);
  background: var(--peach);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
  background: var(--peach-deep);
}

.button-plain {
  background: transparent;
  color: var(--teal-ink);
}

.header-button {
  padding: 8px 16px;
  font-size: 0.88rem;
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  margin: 6px 0 28px;
  border-radius: 32px;
  padding: clamp(24px, 4.5vw, 52px);
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.55), transparent 12rem),
    linear-gradient(135deg, #ffe9d2 0%, #ffcfa3 42%, #ffb77d 62%, #bfe5f4 100%);
  box-shadow: 0 18px 40px rgba(255, 138, 76, 0.25);
  color: var(--ink);
}

.product-hero .eyebrow {
  color: #07525c;
}

.product-hero h1 {
  max-width: 760px;
  margin: 7px 0 14px;
  font-size: clamp(1.8rem, 4.2vw, 3.1rem);
  font-weight: 900;
  line-height: 1.35;
}

.product-hero p:not(.eyebrow):not(.speech-bubble) {
  max-width: 690px;
  margin-bottom: 0;
  color: #2f2938;
  font-size: clamp(0.95rem, 1.7vw, 1.08rem);
  line-height: 2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.hero-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #2f2938;
  font-size: 0.82rem;
  font-weight: 800;
}

.trust-list li::before {
  content: "✓";
  margin-inline-end: 6px;
  color: var(--teal-ink);
}

.hero-side {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.haseeb-hello {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.speech-bubble {
  position: relative;
  max-width: 300px;
  margin: 0;
  border-radius: 24px;
  padding: 12px 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.7;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(50% - 10px);
  bottom: -10px;
  width: 20px;
  height: 20px;
  border-radius: 0 0 6px 0;
  background: #fff;
  transform: rotate(45deg);
}

.haseeb-hero {
  width: clamp(150px, 20vw, 210px);
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(120, 70, 20, 0.22));
}

.hero-progress-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.hero-badge {
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--haseeb);
  font-size: 0.74rem;
  font-weight: 800;
}

.hero-progress-card strong {
  margin: 10px 0 0;
  font-size: 1.8rem;
  line-height: 1.3;
}

.hero-progress-card > span:not(.hero-badge),
.hero-progress-card small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.hero-progress-track,
.dashboard-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--peach-deep);
}

.hero-progress-track {
  margin: 14px 0 8px;
}

.hero-progress-track span,
.dashboard-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--haseeb), var(--sunset));
  transition: width 220ms ease;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.dashboard-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-card h2 {
  margin: 0 0 5px;
  font-size: 1.05rem;
}

.dashboard-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.dashboard-card .button {
  grid-column: 2;
  justify-self: start;
  margin-top: 3px;
}

.card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: var(--peach);
  font-size: 1.35rem;
}

.card-icon-haseeb {
  width: 58px;
  height: 52px;
  padding: 4px;
  background: linear-gradient(160deg, #fff3b8, var(--haseeb));
}

.card-icon-haseeb svg {
  width: 100%;
  height: 100%;
}

.dashboard-progress-track {
  width: 100%;
  margin: 10px 0 8px;
}

.badge-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge-mini {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  background: #fbf6f1;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.badge-mini.earned {
  border-color: var(--haseeb-edge);
  background: linear-gradient(160deg, #fff3b8, var(--haseeb));
  color: var(--ink);
}

.empty-state {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  border-radius: 16px;
  padding: 6px 10px;
  background: var(--sky-soft);
  color: var(--teal-ink);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.6;
}

.section-heading,
.workspace-heading,
.board-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading {
  margin-bottom: 12px;
}

.parent-heading {
  justify-content: flex-start;
}

.parent-heading > div {
  flex: 1;
}

.parent-heading .button {
  flex: none;
}

.heading-haseeb {
  width: 84px;
  height: 70px;
  flex: none;
  filter: drop-shadow(0 6px 8px rgba(120, 70, 20, 0.2));
}

.catalog-section,
.outcomes-section,
.privacy-notice,
.faq-section {
  margin-bottom: 30px;
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: clamp(19px, 3vw, 30px);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-heading {
  align-items: flex-end;
}

.section-intro {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.9;
}

.catalog-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.course-unit-list {
  display: grid;
  gap: 16px;
  margin-top: 23px;
}

.course-unit {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 22px;
}

.course-unit + .course-unit::before {
  content: "";
  position: absolute;
  inset-block-end: 100%;
  inset-inline-start: 32px;
  width: 0;
  height: 16px;
  border-inline-start: 4px dotted var(--peach-deep);
}

.course-unit.demo-unit {
  border-color: #8fd3dc;
}

.unit-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 20px 20px 0 0;
  padding: 16px;
  background: #fff6ec;
}

.demo-unit .unit-head {
  background: var(--sky-soft);
}

.unit-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--peach-deep);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.demo-unit .unit-number {
  background: var(--haseeb);
  box-shadow: 0 3px 0 var(--haseeb-edge);
}

.unit-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.unit-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.unit-status {
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--peach);
  color: var(--oops-ink);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.unit-status.free {
  background: var(--teal-soft);
  color: var(--teal-ink);
}

.unit-body {
  padding: 15px 16px 17px;
}

.unit-goals,
.concept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 13px;
  padding: 0;
  list-style: none;
}

.unit-goals li,
.concept-list li {
  border-radius: 999px;
  padding: 4px 11px;
  background: #fbf3ea;
  color: #4a4454;
  font-size: 0.76rem;
  font-weight: 700;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lesson-card {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  align-items: flex-start;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  background: #fff;
  color: var(--ink);
  text-align: start;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.lesson-card-locked {
  border-style: dashed;
  border-color: #e3c9ae;
  background: linear-gradient(145deg, #fffaf4, #fff0e2);
}

button.lesson-card:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: var(--shadow-soft);
}

.lesson-card .card-index {
  color: var(--teal-ink);
}

.lesson-card-locked .card-index {
  color: var(--oops-ink);
}

.lesson-card strong {
  display: block;
  margin: 4px 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.lesson-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lesson-meta {
  margin-top: auto;
  padding-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.lesson-lock {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--teal-ink);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.5;
}

.lesson-card-locked .lesson-lock {
  color: var(--oops-ink);
}

.icon-lock {
  width: 1.3em;
  height: 1.3em;
}

.outcomes-section {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) 1fr;
  gap: 22px;
  align-items: center;
  background: linear-gradient(135deg, #fff6ea, #eaf6fc);
}

.outcome-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.outcome-list li {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 10px 12px;
  background: white;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.outcome-list span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--haseeb);
  color: var(--ink);
  font-weight: 900;
}

.mission-section {
  margin-bottom: 24px;
}

.demo-section {
  scroll-margin-top: 20px;
}

.progress-label,
.workspace-help,
.mission-number {
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.progress-label {
  padding: 7px 14px;
  background: var(--teal-soft);
  color: var(--teal-ink);
}

.mission-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}

.mission-card {
  min-height: 96px;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  text-align: start;
  transition: transform 150ms ease, border-color 150ms ease;
}

.mission-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.mission-card.active {
  border-color: var(--haseeb-edge);
  background: linear-gradient(160deg, #fffbe6, #fff0a0);
  box-shadow: 0 4px 0 var(--haseeb-edge), var(--shadow-soft);
}

.mission-card.complete .card-index::after {
  content: "✓";
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  margin-inline-start: 6px;
  border-radius: 50%;
  background: var(--success-ink);
  color: #fff;
  font-size: 0.7rem;
}

.card-index {
  display: block;
  margin-bottom: 6px;
  color: var(--teal-ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.card-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.55;
}

.card-level {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(400px, 1.45fr) minmax(400px, 1.25fr);
  grid-template-areas: "mission work board";
  gap: 20px;
  align-items: stretch;
  margin-bottom: 30px;
}

.mission-panel,
.board-panel,
.workspace-panel {
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mission-panel {
  grid-area: mission;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.mission-number {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 5px 14px;
  background: var(--haseeb);
  color: var(--ink);
}

#mission-description {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.9;
}

.hint-box {
  display: flex;
  gap: 9px;
  border: 2px solid #f3d46b;
  border-radius: 18px;
  padding: 12px;
  background: #fff7d6;
}

.hint-box span {
  font-size: 1.2rem;
}

.hint-box p {
  margin: 0;
  color: #5c4300;
  font-size: 0.86rem;
  line-height: 1.8;
}

.mission-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
}

.mission-meta div {
  border-radius: 16px;
  padding: 10px 12px;
  background: var(--sky-soft);
}

.mission-meta dt {
  color: var(--teal-ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.mission-meta dd {
  margin: 3px 0 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.game-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-radius: 20px;
  padding: 10px 12px;
  background: var(--sky-soft);
  color: #3a3544;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.75;
}

.status-haseeb {
  width: 52px;
  height: 44px;
  flex: none;
}

.game-status.running {
  background: var(--teal-soft);
  color: #07505a;
}

.game-status.success {
  background: var(--success-bg);
  color: var(--success-ink);
}

.game-status.failure {
  background: var(--oops-bg);
  color: var(--oops-ink);
}

.board-panel {
  grid-area: board;
  display: flex;
  flex-direction: column;
  padding: 15px;
}

.board-topline {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#phaser-game {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--sky) 0%, #ffe3c8 100%);
  box-shadow: 0 0 0 2px var(--line);
}

#phaser-game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 5px;
}

.robot-legend {
  border: 2px solid var(--haseeb-edge);
  border-radius: 50% 50% 4px 4px;
  background: var(--haseeb);
}

.goal-legend {
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--sunset);
  box-shadow: 0 0 0 1px var(--sunset);
}

.wall-legend {
  background: var(--plum);
}

.workspace-panel {
  grid-area: work;
  display: flex;
  min-height: 595px;
  flex-direction: column;
  overflow: hidden;
}

.workspace-heading {
  padding: 18px 18px 12px;
}

.workspace-help {
  padding: 5px 12px;
  background: var(--peach);
  color: var(--oops-ink);
}

#blockly-workspace {
  min-height: 450px;
  flex: 1;
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 2px solid var(--line);
  padding: 13px 18px 18px;
}

.blocklySvg {
  background: #fffaf3;
}

.blocklyToolboxDiv {
  background: #fff0df;
  font-family: Cairo, Tajawal, Tahoma, Arial, sans-serif;
}

.blocklyTreeLabel,
.blocklyText {
  font-family: Cairo, Tajawal, Tahoma, Arial, sans-serif !important;
}

.privacy-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fffdf8;
}

.privacy-notice > span {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--teal-soft);
  font-size: 1.2rem;
}

.privacy-notice h2 {
  margin: 0 0 5px;
  font-size: 1.02rem;
}

.privacy-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.9;
}

.parent-dashboard {
  margin-bottom: 30px;
  border: 2px solid var(--line);
  border-radius: 28px;
  padding: clamp(19px, 3vw, 30px);
  background: linear-gradient(135deg, #f1fdf5, #fff1e3 55%, #eaf6fc);
  box-shadow: var(--shadow);
}

.parent-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 20px 0 13px;
}

.parent-summary-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: white;
}

.parent-summary-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: #fff3b8;
  font-size: 1.1rem;
}

.parent-summary-card span:not(.parent-summary-icon) {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.parent-summary-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1.08rem;
}

.learning-evidence-grid {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 0.7fr);
  gap: 12px;
}

.learning-evidence-grid > article {
  border-radius: 18px;
  padding: 14px;
  background: white;
}

.learning-evidence-grid h3 {
  margin: 0 0 9px;
  font-size: 0.95rem;
}

.learning-evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.learning-evidence-list li {
  border-radius: 12px;
  padding: 8px 10px;
  background: #fbf3ea;
  color: #4a4454;
  font-size: 0.78rem;
  font-weight: 700;
}

.learning-evidence-list li.observed {
  background: var(--success-bg);
  color: var(--success-ink);
}

.next-activity-card {
  border: 2px solid var(--teal-soft);
  background: var(--sky-soft) !important;
}

.next-activity-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.75;
}

.certificate-sheet {
  margin: 0 24px 26px;
  border: 8px double #e6b422;
  border-radius: 20px;
  padding: 26px 25px;
  background: linear-gradient(180deg, #fffdf2, #fff3e2);
  text-align: center;
}

.certificate-mark {
  display: block;
  width: 108px;
  height: 90px;
  margin: 0 auto 4px;
}

.certificate-sheet h2 {
  margin: 7px 0;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
}

.certificate-sheet > p:not(.eyebrow) {
  margin: 7px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.certificate-sheet strong {
  display: block;
  margin: 13px 0;
  color: var(--ink);
  font-size: 1.4rem;
  overflow-wrap: anywhere;
}

.certificate-note {
  margin-top: 20px !important;
  font-size: 0.74rem !important;
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.faq-list details {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 4px 14px;
  background: #fffdf9;
}

.faq-list summary {
  min-height: 44px;
  padding-block: 9px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.faq-list p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.app-dialog {
  width: min(100% - 28px, 520px);
  max-height: min(90vh, 720px);
  overflow: auto;
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: #fffdf9;
  box-shadow: 0 20px 60px rgba(60, 30, 10, 0.35);
  color: var(--ink);
}

.app-dialog::backdrop {
  background: rgba(60, 30, 10, 0.5);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px 0;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--peach);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.dialog-content {
  padding: 7px 24px 26px;
}

.dialog-copy {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.haseeb-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  border-radius: 20px;
  padding: 8px 12px;
  background: var(--sky-soft);
}

.haseeb-note svg {
  width: 64px;
  height: 54px;
  flex: none;
}

.haseeb-note p {
  margin: 0;
  color: var(--teal-ink);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.7;
}

.auth-form,
.checkout-form {
  display: grid;
  gap: 12px;
}

.access-code-panel {
  margin: 0 0 18px;
  border: 2px solid var(--haseeb-edge);
  border-radius: 20px;
  padding: 15px;
  background: #fffbe6;
}

.access-code-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.access-code-panel > p:not(.form-message) {
  margin: 5px 0 12px;
  color: #4a4454;
  font-size: 0.82rem;
  line-height: 1.7;
}

.access-code-form {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.access-code-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.access-code-controls input,
.auth-form input,
.checkout-form input[type="text"],
.checkout-form input[type="email"] {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 2px solid #e3c9ae;
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  text-align: start;
}

.access-code-controls input {
  direction: ltr;
}

.access-code-controls input:focus,
.auth-form input:focus,
.checkout-form input:focus {
  border-color: var(--teal);
  box-shadow: var(--focus);
  outline: none;
}

.auth-form label,
.checkout-form > label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.checkout-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
}

.checkout-form legend {
  padding-inline: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.checkout-form fieldset label {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.checkout-form input[type="radio"] {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--teal);
}

.checkout-form small {
  color: var(--muted);
  font-weight: 600;
}

.form-message {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.7;
}

.form-message.error {
  color: var(--oops-ink);
}

.form-message.success {
  color: var(--success-ink);
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 22px 0 32px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .product-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.6fr);
  }

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

  .dashboard-card:last-child {
    grid-column: 1 / -1;
  }

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

  .game-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    grid-template-areas:
      "mission mission"
      "work board";
  }

  .workspace-panel {
    min-height: 510px;
  }
}

@media (max-width: 720px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1440px);
  }

  .site-header {
    padding: 14px 0;
  }

  .brand-mark {
    width: 54px;
    height: 48px;
    border-radius: 16px;
  }

  .header-actions {
    gap: 7px;
  }

  .status-chip {
    display: none;
  }

  .header-button {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .product-hero {
    grid-template-columns: 1fr;
    border-radius: 24px;
    padding: 24px 18px;
  }

  .hero-side {
    order: -1;
  }

  .haseeb-hero {
    width: 140px;
  }

  .access-code-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .outcomes-section,
  .parent-summary-grid,
  .learning-evidence-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card:last-child {
    grid-column: auto;
  }

  .catalog-section,
  .outcomes-section,
  .privacy-notice,
  .faq-section,
  .parent-dashboard {
    border-radius: 22px;
    padding: 18px;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .catalog-heading .button,
  .parent-heading .button {
    width: 100%;
  }

  .parent-heading > div {
    flex: 1 1 60%;
  }

  .heading-haseeb {
    width: 64px;
    height: 54px;
  }

  .unit-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .unit-status {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
  }

  .lesson-grid,
  .outcome-list,
  .learning-evidence-list {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    min-height: 124px;
  }

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

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "mission"
      "work"
      "board";
  }

  .workspace-panel {
    min-height: 440px;
  }

  #blockly-workspace {
    min-height: 390px;
  }

  .mission-panel {
    padding: 18px;
  }

  .workspace-actions .button {
    flex: 1 1 auto;
  }
}

@media (max-width: 400px) {
  .brand-title.wordmark {
    font-size: 1.45rem;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

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

.game-layout {
  scroll-margin-top: 12px;
}

/* Compact hero: the game must be reachable without a long scroll. */
.product-hero {
  margin: 4px 0 18px;
  border-radius: 28px;
  padding: clamp(16px, 2.4vw, 28px);
}

.product-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.product-hero .hero-copy > p:not(.eyebrow) {
  font-size: 0.95rem;
  line-height: 1.8;
}

.hero-actions {
  margin: 14px 0 10px;
}

.haseeb-hero {
  width: clamp(110px, 12vw, 150px);
}

.hero-progress-card {
  display: none;
}

@media (max-width: 720px) {
  .product-hero {
    margin-bottom: 14px;
    padding: 14px 16px;
  }

  .product-hero .hero-copy > p:not(.eyebrow),
  .trust-list,
  .hero-link,
  .speech-bubble {
    display: none;
  }

  .haseeb-hero {
    width: 84px;
  }

  .hero-actions {
    margin: 10px 0 0;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .product-hero .hero-copy > p:not(.eyebrow),
  .trust-list,
  .hero-side {
    display: none;
  }

  .product-hero {
    grid-template-columns: 1fr;
    padding: 12px 18px;
  }
}

/* Phone in landscape: blocks panel on the start (right) side, game board beside it. */
@media (orientation: landscape) and (max-height: 540px) {
  .site-header {
    padding: 6px 0;
  }

  .game-layout {
    height: calc(100dvh - 16px);
    scroll-margin-top: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "mission mission"
      "work board";
    gap: 8px;
    margin-bottom: 14px;
  }

  .mission-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) minmax(0, 1.2fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 14px;
    border-radius: 18px;
    padding: 6px 14px;
  }

  .mission-panel .mission-number {
    margin: 0;
    padding: 3px 10px;
    font-size: 0.74rem;
  }

  .mission-panel .mission-number {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .mission-panel h2 {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: 0.95rem;
  }

  .mission-panel #mission-description,
  .mission-panel .mission-meta {
    display: none;
  }

  .mission-panel .hint-box {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 4px 9px;
    border-radius: 12px;
  }

  .mission-panel .hint-box p {
    font-size: 0.74rem;
    line-height: 1.5;
  }

  .mission-panel .game-status {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin: 0;
    padding: 4px 10px;
  }

  .game-status .status-haseeb {
    width: 34px;
    height: 30px;
  }

  .workspace-panel {
    min-height: 0;
    border-radius: 18px;
  }

  .workspace-heading {
    display: flex;
    padding: 6px 12px 4px;
  }

  .workspace-heading .eyebrow,
  .workspace-help {
    display: none;
  }

  .workspace-heading h2 {
    margin: 0;
    font-size: 0.9rem;
  }

  #blockly-workspace {
    min-height: 0;
  }

  .workspace-actions {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px 10px;
  }

  .workspace-actions .button {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 6px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .board-panel {
    min-height: 0;
    border-radius: 18px;
    padding: 8px;
  }

  .board-topline {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }

  #phaser-game {
    width: calc(100dvh - 160px);
    border-radius: 16px;
  }

  .board-legend {
    gap: 10px;
    margin-top: 6px;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #certificate-sheet,
  #certificate-sheet * {
    visibility: visible;
  }

  #certificate-sheet {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    width: 100%;
    margin: 0;
    border-width: 8px;
  }
}
