/* Homepage (public/home.js), matching docs/master/APPROVED_HOMEPAGE_REFERENCE.png: a warm dusk study
   room in purple, lavender and gold; frosted rounded panels; soft glows on the key cards.
   Mobile-first: one column in the spec's phone order; wider screens use the reference's layout.
   All drawing is CSS gradients and inline SVG. The only images are the optional founder artwork
   slots (public/art/*.webp, same origin), which home.js shows only once a file has loaded; until
   then the drawings below stay. Logical properties keep right-to-left layouts possible.
   Everything is scoped to .hp. The student app has no tutor carousel and shows Today's Mission
   only with real data (data-tutors / data-mission on .hp), so the grid is balanced without them. */

.hp {
  --hp-ink: #1d1b3a;
  --hp-soft-ink: #4b4775;
  --hp-violet: #5b3fd6;
  --hp-violet-deep: #3f2aa8;
  --hp-gold: #ffc94a;
  --hp-glass: rgb(255 255 255 / 82%);
  --hp-dark-glass: rgb(44 26 96 / 80%);
  --hp-edge: rgb(255 255 255 / 22%);
  --hp-radius: 28px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px 16px;
  min-height: 100vh;
  min-height: 100svh;
  /* clip, not a scroll container, so the shell's sticky notices stay in view */
  overflow: hidden;
  overflow: clip;
  color: var(--hp-ink);
  font-family: "Noto Sans Malayalam", "Nunito", "Baloo 2", "Varela Round", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.35;
}

/* The study-room scene (home.js draws it as SVG); softly blurred like a depth-of-field photo. */
.hp-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(160deg, #2c1f5e 0%, #5a3f9a 45%, #a46fb3 80%, #e9b48f 100%);
}
.hp-scene-art { width: 100%; height: 100%; display: block; filter: blur(3px) saturate(1.05); transform: scale(1.02); }
/* A vignette and a lavender haze keep the cards readable over the scene. */
.hp-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgb(255 220 240 / 0%) 30%, rgb(30 15 70 / 45%) 100%),
    linear-gradient(180deg, rgb(40 20 90 / 25%), rgb(90 50 150 / 10%) 50%, rgb(60 30 90 / 35%));
}

/* ---------- Top bar ---------- */
.hp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 3; }
.hp-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 6px 14px 6px 8px; border-radius: 20px;
  background: var(--hp-dark-glass); color: #ffffff;
  box-shadow: inset 0 0 0 1px var(--hp-edge), 0 8px 22px rgb(20 8 60 / 30%);
  backdrop-filter: blur(10px);
}
.hp-logo { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 30%)); }
.hp-brand p { margin: 0; }
.hp-brand-name { font-weight: 900; font-size: 1.25rem; line-height: 1.1; letter-spacing: 0.01em; }
.hp-tagline { font-size: 0.74rem; font-weight: 700; opacity: 0.95; }
.hp-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hp-pill {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  min-height: 44px; padding: 4px 14px; border-radius: 999px; border: 0;
  background: var(--hp-dark-glass); color: #ffffff; font: inherit; font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--hp-edge), 0 6px 16px rgb(20 8 60 / 28%);
  backdrop-filter: blur(10px);
}
.hp-pill .hp-icon { width: 24px; height: 24px; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 30%)); }
.hp-num { font-size: 1.15rem; }
.hp-profile { position: relative; }
button.hp-who { cursor: pointer; }
.hp-avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe7b0, #ff9fb8); color: var(--hp-ink); font-weight: 900;
  box-shadow: 0 0 0 2px #ffffff;
}
.hp-who-name { unicode-bidi: isolate; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-menu {
  position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 6px); z-index: 5;
  margin: 0; padding: 6px; list-style: none; min-width: 200px;
  border-radius: 18px; background: #ffffff; box-shadow: 0 10px 30px rgb(30 15 80 / 30%);
}
.hp-menu[hidden] { display: none; }
.hp-menu-item {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 12px;
  background: transparent; color: var(--hp-ink); font: inherit; font-weight: 700; text-align: start; cursor: pointer;
}
.hp-menu-item:hover { background: #f1edff; }

/* ---------- Greeting: the tutor and its speech bubble ---------- */
.hp-hero { display: flex; align-items: flex-end; gap: 8px; position: relative; z-index: 1; }
.hp-learner { display: none; } /* phones: the student character hides (design spec) */
.hp-tutor { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.hp-tutor-art, .hp-tutor-photo { flex: none; width: 76px; height: 76px; filter: drop-shadow(0 10px 16px rgb(40 20 100 / 40%)); }
.hp-bubble {
  position: relative; flex: 1; min-width: 0; padding: 10px 14px; border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #f6f1ff); box-shadow: 0 0 0 2px rgb(255 255 255 / 80%), 0 10px 26px rgb(40 20 100 / 30%);
}
/* The bubble's tail points at the tutor (mirrored for right-to-left). */
.hp-bubble::before {
  content: ""; position: absolute; inset-inline-start: -9px; inset-block-end: 22px;
  width: 20px; height: 20px; background: #fbf8ff; transform: rotate(45deg); border-radius: 4px;
}
.hp-bubble p { margin: 0; position: relative; }
.hp-greeting { font-size: 1.02rem; font-weight: 800; line-height: 1.3; }
.hp-hello { margin-block-start: 2px !important; color: var(--hp-soft-ink); font-size: 0.92rem; }
.hp-ai { margin-block-start: 4px !important; font-size: 0.78rem; font-weight: 700; color: var(--hp-soft-ink); }

/* ---------- Cards ---------- */
.hp-card { border-radius: var(--hp-radius); padding: 14px 16px; position: relative; z-index: 1; }
.hp-card h2, .hp-card p { margin: 0; }
.hp-continue {
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(150deg, rgb(255 255 255 / 96%), rgb(238 230 255 / 93%) 60%, rgb(226 214 255 / 92%));
  box-shadow: 0 0 0 2px rgb(255 255 255 / 85%), 0 0 30px rgb(200 170 255 / 75%), 0 14px 32px rgb(40 20 100 / 28%);
}
.hp-continue-art { width: 60px; height: 60px; flex: none; align-self: flex-start; filter: drop-shadow(0 6px 8px rgb(60 30 140 / 30%)); }
.hp-continue-body { display: grid; gap: 5px; flex: 1; min-width: 0; }
.hp-label { font-size: 1rem; font-weight: 800; color: var(--hp-violet); }
.hp-title { font-size: 1.25rem; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.hp-meta { color: var(--hp-soft-ink); font-weight: 700; font-size: 0.95rem; }
.hp-source {
  justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800;
  background: #e6f6ee; color: #145c3a;
}
.hp-source[data-source="draft"] { background: #fff1d6; color: #6b4300; }
.hp-bar-meter {
  width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden;
  appearance: none; background: #e3ddf5; accent-color: #2f9e5f;
}
.hp-bar-meter::-webkit-progress-bar { background: #e3ddf5; border-radius: 999px; }
.hp-bar-meter::-webkit-progress-value { background: linear-gradient(90deg, #2f9e5f, #6fd88a); border-radius: 999px; }
.hp-bar-meter::-moz-progress-bar { background: linear-gradient(90deg, #2f9e5f, #6fd88a); border-radius: 999px; }
.hp-gold { accent-color: var(--hp-gold); background: rgb(255 255 255 / 25%); }
.hp-gold::-webkit-progress-bar { background: rgb(255 255 255 / 25%); }
.hp-gold::-webkit-progress-value { background: linear-gradient(90deg, #ffb020, #ffd76a); }
.hp-gold::-moz-progress-bar { background: linear-gradient(90deg, #ffb020, #ffd76a); }
.hp-go {
  justify-self: end; min-height: 52px; padding: 10px 28px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #6a4ee8, var(--hp-violet-deep)); color: #ffffff;
  font: inherit; font-size: 1.15rem; font-weight: 900; cursor: pointer;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 30%), 0 8px 18px rgb(63 42 168 / 45%);
}

.hp-mission {
  display: flex; gap: 14px; align-items: center; color: #ffffff;
  background: linear-gradient(150deg, #4a30b0, #5f3dc0 60%, #6a44c8); /* gold text stays at 4.5:1 or more */
  box-shadow: 0 0 0 2px rgb(255 196 100 / 95%), 0 0 26px rgb(255 160 70 / 60%), 0 14px 30px rgb(40 20 100 / 30%);
}
.hp-mission-art { width: 60px; height: 60px; flex: none; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 30%)); }
.hp-mission > div { display: grid; gap: 5px; min-width: 0; }
.hp-mission-title { font-size: 1.3rem; font-weight: 900; }
.hp-mission-text { font-size: 1.02rem; font-weight: 700; }
.hp-mission-reward { color: #ffe08a; font-weight: 800; }
.hp-mission-count { font-weight: 700; }
.hp-ghost {
  justify-self: start; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 2px solid rgb(255 255 255 / 85%); background: rgb(255 255 255 / 8%); color: #ffffff;
  font: inherit; font-weight: 800; cursor: pointer;
}

/* ---------- Subjects ---------- */
.hp-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; position: relative; z-index: 1; }
.hp-subject {
  display: grid; justify-items: center; align-content: center; gap: 6px;
  min-height: 108px; padding: 12px 8px; border: 3px solid rgb(255 255 255 / 70%); border-radius: 26px;
  color: var(--hp-ink); font: inherit; font-size: 1.12rem; font-weight: 900; cursor: pointer;
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 70%), inset 0 -6px 0 rgb(60 30 120 / 8%), 0 10px 20px rgb(40 20 100 / 25%);
  background: linear-gradient(165deg, #fff3fb, #f8cfee);
}
.hp-subject[data-world="maths"] { background: linear-gradient(165deg, #f4edff, #d4c2ff); }
.hp-subject[data-world="science"] { background: linear-gradient(165deg, #ecfff7, #b4ecd6); }
.hp-subject[data-world="english"] { background: linear-gradient(165deg, #fff6ea, #ffd3a4); }
.hp-subject[data-world="social"] { background: linear-gradient(165deg, #fff1ef, #ffc2b9); }
.hp-subject[data-world="computer"] { background: linear-gradient(165deg, #f0f3ff, #c6d1ff); }
.hp-subject[data-world="more"] { background: linear-gradient(165deg, #fff0fb, #f6c4ea); }
.hp-subject[aria-pressed="true"] {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgb(255 255 255 / 90%), 0 0 26px rgb(196 150 255 / 95%), 0 10px 20px rgb(40 20 100 / 25%);
}
.hp-subject-art, .hp-subject-photo { width: 50px; height: 50px; filter: drop-shadow(0 4px 5px rgb(40 20 100 / 25%)); }
.hp-subject-name { line-height: 1.12; text-align: center; overflow-wrap: anywhere; }

/* ---------- My Progress ---------- */
.hp-progress {
  color: #ffffff; background: var(--hp-dark-glass); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--hp-edge), 0 14px 30px rgb(20 8 60 / 35%);
}
.hp-progress-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hp-progress-title { font-size: 1.3rem; font-weight: 900; }
.hp-chevron {
  min-width: 44px; min-height: 44px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / 14%); color: #ffffff; font-size: 1.6rem; font-weight: 900; cursor: pointer;
}
[dir="rtl"] .hp-chevron { transform: scaleX(-1); }
.hp-progress-row { display: flex; gap: 14px; align-items: center; margin-block-start: 6px; }
.hp-ring-box { position: relative; width: 108px; height: 108px; flex: none; }
.hp-ring { width: 108px; height: 108px; filter: drop-shadow(0 0 8px rgb(255 201 74 / 40%)); }
.hp-ring-track { stroke: rgb(255 255 255 / 18%); }
.hp-ring-fill { stroke: var(--hp-gold); }
.hp-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; margin: 0; }
.hp-ring-num { font-size: 1.5rem; font-weight: 900; }
.hp-ring-sub { font-size: 0.68rem; max-width: 70px; line-height: 1.1; font-weight: 700; }
.hp-facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; min-width: 0; }
.hp-facts li { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.hp-facts .hp-icon { width: 26px; height: 26px; flex: none; }

/* ---------- Tutor carousel ---------- */
.hp-tutors {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--hp-radius);
  background: rgb(255 240 250 / 22%); backdrop-filter: blur(10px); position: relative; z-index: 1;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 30%), 0 10px 26px rgb(20 8 60 / 25%);
}
.hp-change {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 52px; padding: 6px 16px 6px 8px; border: 0; border-radius: 999px;
  background: var(--hp-dark-glass); color: #ffffff; font: inherit; font-weight: 800; line-height: 1.15; cursor: pointer;
  max-width: 9.5em; text-align: start;
}
.hp-play { width: 34px; height: 34px; flex: none; }
.hp-track {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  flex: 1; padding: 6px; scrollbar-width: thin;
}
.hp-tile {
  position: relative; display: grid; justify-items: center; align-content: end; gap: 2px; flex: none;
  scroll-snap-align: start; width: 104px; min-height: 118px; padding: 6px; border: 3px solid rgb(255 255 255 / 55%); border-radius: 24px;
  background: linear-gradient(165deg, #ffffff, #e8defc); color: var(--hp-ink); font: inherit; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 14px rgb(40 20 100 / 22%);
}
.hp-tile[data-tutor="arjun"], .hp-tile[data-tutor="kai"], .hp-tile[data-tutor="tara"] { background: linear-gradient(165deg, #eef2ff, #c4ccff); }
.hp-tile[data-tutor="zara"], .hp-tile[data-tutor="asha"] { background: linear-gradient(165deg, #fff4ec, #ffd1c0); }
.hp-tile[data-tutor="orbi"], .hp-tile[data-tutor="hoota"] { background: linear-gradient(165deg, #f4efff, #d2c4ff); }
.hp-tile[data-tutor="kesari"], .hp-tile[data-tutor="nova"] { background: linear-gradient(165deg, #fff6e2, #ffd59a); }
.hp-tile[data-tutor="meera"] { background: linear-gradient(165deg, #fff0f6, #ffc6dc); }
.hp-tile[data-tutor="pebble"], .hp-tile[data-tutor="bipo"] { background: linear-gradient(165deg, #f2f0ff, #cfd6ff); }
.hp-tile[data-tutor="ember"] { background: linear-gradient(165deg, #fff0fb, #f3c2ff); }
.hp-tile[aria-pressed="true"] { border-color: #ffffff; box-shadow: 0 0 0 3px #ffffff, 0 0 22px rgb(196 150 255 / 95%); }
.hp-tile-art { width: 78px; height: 78px; }
.hp-tile-name { font-size: 0.82rem; line-height: 1.1; text-align: center; }
.hp-tick {
  position: absolute; inset-block-end: 26px; inset-inline-end: 6px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--hp-violet); color: #ffffff; font-weight: 900;
  box-shadow: 0 0 0 2px #ffffff;
}
.hp-next {
  flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: linear-gradient(180deg, #7a5cf5, var(--hp-violet-deep)); color: #ffffff; font-size: 1.8rem; font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 14px rgb(63 42 168 / 40%);
}
[dir="rtl"] .hp-next { transform: scaleX(-1); }

/* ---------- Artwork slots (founder files; home.js artSlot) ----------
   An image is hidden until it loads; then its holder has data-art="ready" and the drawn fallback
   is hidden. A missing file leaves the drawing exactly as it was. */
.hp-art { display: block; pointer-events: none; user-select: none; }
.hp-art[hidden] { display: none; }
/* The approved room photo (home-background.png) sits behind the real cards. Its child is on the
   left, so the photo is anchored there; the drawn student is then not needed. Its robot is
   decoration, not a tutor (Nova is the tutor, named and labelled as an AI in the greeting). */
.hp-scene-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 18% 40%; }
.hp-scene[data-art="ready"] > .hp-scene-art { display: none; }
.hp[data-art="ready"] .hp-learner { display: none; }
.hp-tutor-frame { display: contents; }
.hp-tutor-frame[data-art="ready"] > .hp-tutor-art { display: none; }
.hp-tutor-photo { object-fit: cover; object-position: 50% 22%; border-radius: 50%; box-shadow: 0 0 0 4px #ffffff, 0 10px 22px rgb(40 20 100 / 40%); filter: none; background: #e9e3ff; }
.hp-subject[data-art="ready"] > .hp-subject-art { display: none; }
.hp-subject-photo { object-fit: contain; }

/* ---------- Shared ---------- */
.hp-vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.hp button:focus-visible { outline: 4px solid var(--hp-gold); outline-offset: 3px; }
.hp [tabindex="-1"]:focus { outline: none; }

/* Gentle motion only, and none when reduced motion is asked for. */
@media (prefers-reduced-motion: no-preference) {
  .hp-tutor-art, .hp-tutor-photo { animation: hp-float 5s ease-in-out infinite; }
  .hp-go, .hp-subject, .hp-tile { transition: transform 0.15s ease; }
  .hp-go:hover, .hp-subject:hover, .hp-tile:hover { transform: translateY(-2px); }
}
@keyframes hp-float { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .hp *, .hp *::before, .hp *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Small phones (360 px): keep Let's Learn on the first screen ---------- */
@media (max-width: 400px) {
  .hp { gap: 10px; padding: 8px 10px 14px; }
  .hp-brand { padding: 4px 10px 4px 6px; gap: 8px; }
  .hp-logo { width: 32px; height: 32px; }
  .hp-brand-name { font-size: 1.1rem; }
  .hp-tagline { font-size: 0.68rem; }
  .hp-pill { padding: 4px 10px; }
  .hp-tutor-art, .hp-tutor-photo { width: 64px; height: 64px; }
  .hp-greeting { font-size: 0.98rem; }
  .hp-hello { display: none; } /* the greeting itself stays; its second line waits for wider screens */
  .hp-continue-art { width: 48px; height: 48px; }
  .hp-title { font-size: 1.15rem; }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .hp { padding: 16px 18px; gap: 14px; }
  .hp-subjects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hp-tutor-art, .hp-tutor-photo { width: 120px; height: 120px; }
  .hp-continue-art { width: 84px; height: 84px; }
  .hp-greeting { font-size: 1.2rem; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .hp {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "bar bar"
      "tutor tutor"
      "continue continue"
      "mission progress"
      "subjects subjects"
      "tutors tutors";
  }
  .hp-bar { grid-area: bar; }
  .hp-hero { display: contents; }
  .hp-tutor { grid-area: tutor; }
  .hp-continue { grid-area: continue; }
  .hp-mission { grid-area: mission; }
  .hp-progress { grid-area: progress; }
  .hp-subjects { grid-area: subjects; }
  .hp-tutors { grid-area: tutors; }
  /* No tutor carousel (the student app: Nova only), and/or no mission without real data. */
  .hp[data-tutors="false"] {
    grid-template-areas:
      "bar bar"
      "tutor tutor"
      "continue continue"
      "mission progress"
      "subjects subjects";
  }
  .hp[data-mission="false"] {
    grid-template-areas:
      "bar bar"
      "tutor tutor"
      "continue continue"
      "subjects subjects"
      "progress progress"
      "tutors tutors";
  }
  .hp[data-mission="false"][data-tutors="false"] {
    grid-template-areas:
      "bar bar"
      "tutor tutor"
      "continue continue"
      "subjects subjects"
      "progress progress";
  }
}

/* ---------- Desktop: the reference layout (16:9, one screen) ---------- */
@media (min-width: 1024px) {
  .hp {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.45fr) minmax(0, 1.05fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "bar bar bar"
      "learner tutor progress"
      "learner continue mission"
      "subjects subjects subjects"
      "tutors tutors tutors";
    align-content: space-between;
    column-gap: clamp(14px, 1.6vw, 28px);
    row-gap: clamp(10px, 1.6vh, 18px);
    padding: clamp(12px, 1.6vh, 20px) clamp(18px, 2vw, 32px) clamp(12px, 1.8vh, 22px);
  }
  .hp-bar { grid-area: bar; }
  /* The greeting section's two parts take their own grid areas (the section keeps its label). */
  .hp-hero { display: contents; }
  .hp-learner {
    grid-area: learner; display: block; z-index: 0;
    width: 118%; max-width: 520px; height: auto; max-height: 62vh;
    align-self: end; justify-self: start; margin-inline-start: -4%; margin-block-end: -6vh;
    filter: drop-shadow(0 18px 24px rgb(30 10 70 / 45%));
  }
  .hp-tutor { grid-area: tutor; align-self: end; gap: 6px; }
  .hp-tutor-art, .hp-tutor-photo { width: clamp(140px, 13vw, 210px); height: clamp(140px, 13vw, 210px); margin-block-end: -26px; z-index: 0; }
  .hp-bubble { padding: 16px 22px; border-radius: 30px; align-self: flex-start; }
  .hp-greeting { font-size: clamp(1.15rem, 1.45vw, 1.6rem); line-height: 1.25; }
  .hp-hello { font-size: 1rem; }
  .hp-continue { grid-area: continue; align-self: stretch; padding: clamp(16px, 2vh, 24px) clamp(18px, 1.6vw, 28px); gap: 20px; }
  .hp-continue-art { width: clamp(96px, 8.5vw, 140px); height: clamp(96px, 8.5vw, 140px); align-self: center; }
  .hp-continue .hp-label { font-size: 1.25rem; }
  .hp-continue .hp-title { font-size: clamp(1.4rem, 1.75vw, 1.9rem); }
  .hp-continue .hp-bar-meter { height: 14px; }
  .hp-go { font-size: 1.35rem; padding: 12px 34px; }
  .hp-mission { grid-area: mission; align-self: stretch; padding: 22px 26px; }
  .hp-mission-title { font-size: clamp(1.4rem, 1.9vw, 2rem); }
  .hp-mission-art { width: 96px; height: 96px; }
  .hp-progress { grid-area: progress; align-self: end; }
  .hp-progress-title { font-size: 1.5rem; }
  .hp-ring-box, .hp-ring { width: clamp(108px, 8.6vw, 140px); height: clamp(108px, 8.6vw, 140px); }
  .hp-ring-num { font-size: 1.8rem; }
  .hp-subjects {
    grid-area: subjects; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 20px);
    padding-inline: clamp(0px, 7vw, 140px) clamp(0px, 3vw, 60px);
  }
  .hp-subject { min-height: clamp(112px, 17vh, 168px); font-size: clamp(1.1rem, 1.6vw, 1.75rem); border-radius: 30px; }
  .hp-subject-art, .hp-subject-photo { width: clamp(52px, 4.6vw, 80px); height: clamp(52px, 4.6vw, 80px); }
  .hp-tutors { grid-area: tutors; margin-inline: clamp(0px, 5vw, 100px) clamp(0px, 7vw, 130px); }
  .hp-change { font-size: 1.1rem; min-height: 64px; }
  .hp-tile { width: clamp(104px, 8.6vw, 144px); min-height: clamp(104px, 11vh, 118px); }
  .hp-tile-art { width: clamp(72px, 6vw, 96px); height: clamp(72px, 6vw, 96px); }

  /* The student app (Nova only): no carousel row. The subject row becomes the page's base, with a
     little more height so the screen stays balanced. */
  .hp[data-tutors="false"] {
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "bar bar bar"
      "learner tutor progress"
      "learner continue mission"
      "subjects subjects subjects";
  }
  .hp[data-tutors="false"] .hp-subjects { padding-inline: clamp(0px, 4vw, 90px) clamp(0px, 2vw, 40px); }
  .hp[data-tutors="false"] .hp-subject { min-height: clamp(124px, 19vh, 184px); }
  /* No mission without real data: My Progress takes the whole right column, centred. */
  .hp[data-mission="false"] {
    grid-template-areas:
      "bar bar bar"
      "learner tutor progress"
      "learner continue progress"
      "subjects subjects subjects"
      "tutors tutors tutors";
  }
  .hp[data-mission="false"][data-tutors="false"] {
    grid-template-areas:
      "bar bar bar"
      "learner tutor progress"
      "learner continue progress"
      "subjects subjects subjects";
  }
  .hp[data-mission="false"] .hp-progress { align-self: center; padding: 22px 24px; }
  .hp[data-mission="false"] .hp-progress-row { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ---------- Older students: same layout and brand, quieter palette, smaller character ---------- */
.hp[data-older="true"] .hp-scene-art { filter: blur(5px) saturate(0.6) brightness(0.8); }
.hp[data-older="true"] .hp-learner { display: none; }
@media (min-width: 1024px) {
  .hp[data-older="true"] {
    grid-template-areas:
      "bar bar bar"
      "tutor tutor progress"
      "continue continue mission"
      "subjects subjects subjects"
      "tutors tutors tutors";
  }
  .hp[data-older="true"][data-tutors="false"] {
    grid-template-areas:
      "bar bar bar"
      "tutor tutor progress"
      "continue continue mission"
      "subjects subjects subjects";
  }
  .hp[data-older="true"][data-mission="false"] {
    grid-template-areas:
      "bar bar bar"
      "tutor tutor progress"
      "continue continue progress"
      "subjects subjects subjects"
      "tutors tutors tutors";
  }
  .hp[data-older="true"][data-mission="false"][data-tutors="false"] {
    grid-template-areas:
      "bar bar bar"
      "tutor tutor progress"
      "continue continue progress"
      "subjects subjects subjects";
  }
}
.hp[data-older="true"] .hp-tutor-art, .hp[data-older="true"] .hp-tutor-photo { width: 72px; height: 72px; animation: none; margin: 0; }
.hp[data-older="true"] .hp-greeting { font-size: 1rem; }
.hp[data-older="true"] .hp-continue { box-shadow: 0 10px 26px rgb(10 5 40 / 35%); }
.hp[data-older="true"] .hp-mission { background: #3a3470; box-shadow: 0 0 0 1px rgb(255 201 74 / 60%); }
.hp[data-older="true"] .hp-subject { min-height: 88px; font-size: 1rem; background: #f4f2fb; }
.hp[data-older="true"] .hp-subject-art, .hp[data-older="true"] .hp-subject-photo { width: 36px; height: 36px; }
