/* gomi-sensei.com, the homepage.
 *
 * Page styles only, on top of site.css (tokens, base, type, buttons, header,
 * footer). The classroom in the hero is plain CSS 3D, sized in container units
 * (cqw) against `.classroom`, so the whole room scales as one picture on any
 * width instead of reflowing piece by piece.
 */

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  max-width: 1392px;
  margin: 0 auto;
  padding: 48px 5% 64px;
  overflow-x: clip;
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  align-items: center;
  gap: 28px;
}

.hero__copy { min-width: 0; position: relative; z-index: 1; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mute);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}
.hero__eyebrow > span {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 12%, transparent);
}
.hero h1 {
  margin-top: 22px;
  font-size: clamp(48px, 5.6vw, 80px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 900;
}
.hero__sub {
  margin-top: 24px;
  max-width: 440px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--soft);
}
.hero__curriculum {
  max-width: 440px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--mute);
}
.hero__actions { margin-top: 26px; }
.hero__enter {
  width: 100%;
  max-width: 440px;
  justify-content: space-between;
  padding: 19px 25px;
  font-size: 22px;
}
.hero__enter > span { font-size: 29px; line-height: 1; }
.hero__note {
  margin-top: 17px;
  font-size: 13px;
  color: var(--soft);
}
.hero__note > span { color: var(--mute); font-size: 12px; }

/* A take-home slip: visibly a second way to learn, inside the same hero. */
.mobile-note {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 440px;
  margin-top: 30px;
  padding: 19px 20px;
  border-radius: 3px 14px 14px 3px;
  border-left: 4px solid #d5ae63;
  background: #f3ead6;
  color: #233956;
  box-shadow: 3px 5px 0 rgba(3, 12, 29, .16);
}
.mobile-note::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 25px;
  width: 45px;
  height: 15px;
  background: #c7d3cd;
  opacity: .85;
  transform: rotate(-6deg);
}
.mobile-note > img { flex: none; border-radius: 11px; }
.mobile-note__copy { min-width: 0; }
.mobile-note h2 { font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.mobile-note p { margin-top: 4px; font-size: 12px; color: #526079; }
.mobile-note__download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.mobile-note__download:hover { color: #35629b; }
.mobile-note__download .apple-mark { width: 14px; height: 16px; }
.mobile-note__stamp {
  margin-left: auto;
  padding: 7px;
  border: 2px solid #9c6548;
  border-radius: 50%;
  color: #9c6548;
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: .08em;
  text-align: center;
  transform: rotate(12deg);
}

/* ── The classroom (CSS 3D) ─────────────────────────────────────────────── */

.classroom {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.06;
  margin-bottom: 44px;
  perspective: 1200px;
  container-type: inline-size;
  isolation: isolate;
}

/* The scene's own plane sits in front of the wall in 3D, so it would take the
 * clicks meant for anything hung on the wall. Only the real controls in the room
 * accept the pointer; the parallax listener is on .classroom, which still gets
 * every move. */

.room-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-style: preserve-3d;
  transform: rotateX(calc(3deg + var(--look-x, 0deg))) rotateY(calc(-10deg + var(--look-y, 0deg)));
  transition: transform 0.25s ease-out;
}

.room-wall {
  position: absolute;
  left: 0;
  top: 4%;
  width: 100%;
  height: 82%;
  border-radius: 45% 0 0 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, rgba(47, 95, 167, 0.08), rgba(66, 115, 184, 0.3));
  transform: translateZ(-35px);
}

:root[data-theme="light"] .room-wall {
  background: linear-gradient(110deg, rgba(237, 245, 253, 0.2), rgba(95, 134, 182, 0.28));
}

.room-light {
  position: absolute;
  top: 3%;
  left: 30%;
  width: 22%;
  height: 4%;
  border-radius: 50% 50% 8px 8px;
  background: linear-gradient(#4273b8, #1e3e70);
  box-shadow: 0 5px 0 #081b36;
  transform: translateZ(35px);
}

.room-light::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 2px;
  height: 2.6cqw;
  background: #7fa4d2;
}

.room-light span {
  position: absolute;
  left: 6%;
  bottom: -0.6cqw;
  width: 88%;
  height: 0.8cqw;
  border-radius: 50%;
  background: #fff2ac;
  box-shadow:
    0 0.7cqw 3cqw rgba(255, 215, 110, 0.45),
    0 2cqw 7cqw 1.5cqw rgba(255, 215, 110, 0.16);
}

/* The Lights switch is a real wall switch, because controls live in the room
 * rather than in a menu (Carson, 2026-09-16): an off-white plate with two
 * screws and a wide rocker, like the ones by every classroom door in Japan.
 * The top of the rocker pressed in means the lights are on, which is the light
 * theme, and the ceiling lamp follows it. The amber pilot light glows while the
 * lights are off, which is how you find a switch in the dark. */

.wall-switch {
  position: absolute;
  left: 82.5%;
  top: 26%;
  width: 9.5%;
  aspect-ratio: 0.6;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translateZ(-30px);
}

.wall-switch::before {
  content: "";
  position: absolute;
  inset: -12% -30%;
  border-radius: 1.2cqw;
}

.wall-switch:focus-visible {
  outline: none;
}

.wall-switch:focus-visible::before {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wall-switch__plate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 7% 0;
  border-radius: 0.9cqw;
  background: linear-gradient(155deg, #fbf9f4 0%, #ebe6dc 55%, #d9d2c4 100%);
  box-shadow:
    inset 0 0 0 0.25cqw rgba(255, 255, 255, 0.7),
    inset -0.35cqw -0.45cqw 0 rgba(120, 108, 88, 0.22),
    0.5cqw 0.6cqw 0 #a79e8d,
    1.4cqw 2cqw 2.6cqw rgba(3, 13, 34, 0.45);
  transition: transform 0.2s;
}

:root:not([data-theme="light"]) .wall-switch__plate {
  background: linear-gradient(155deg, #b9c2cf 0%, #98a3b4 55%, #7d889b 100%);
  box-shadow:
    inset 0 0 0 0.25cqw rgba(255, 255, 255, 0.25),
    inset -0.35cqw -0.45cqw 0 rgba(10, 20, 40, 0.25),
    0.5cqw 0.6cqw 0 #56627a,
    1.4cqw 2cqw 2.6cqw rgba(3, 13, 34, 0.6);
}

.wall-switch:hover .wall-switch__plate {
  transform: translateY(-0.4cqw);
}

.wall-switch__screw {
  position: relative;
  display: block;
  width: 1.1cqw;
  height: 1.1cqw;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b9b1a3 70%);
  box-shadow: inset 0 0 0 0.12cqw rgba(90, 80, 64, 0.35);
}

.wall-switch__screw::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 50%;
  height: 0.14cqw;
  margin-top: -0.07cqw;
  background: rgba(90, 80, 64, 0.55);
  transform: rotate(-35deg);
}

/* The rocker is one wide paddle that tilts about its middle; the pressed half
 * sinks and darkens, the raised half catches the light. */

.wall-switch__rocker {
  position: relative;
  display: block;
  width: 64%;
  height: 62%;
  border-radius: 0.5cqw;
  background: linear-gradient(#e9e4da 0%, #fffdf8 42%, #fffdf8 58%, #cfc7b8 100%);
  box-shadow:
    0 0 0 0.3cqw #c8c0b1,
    0 0.7cqw 0.4cqw -0.1cqw rgba(60, 50, 36, 0.45);
  transform: perspective(12cqw) rotateX(-14deg);
  transition:
    transform 0.22s cubic-bezier(0.3, 1.5, 0.5, 1),
    box-shadow 0.22s;
}

:root[data-theme="light"] .wall-switch__rocker {
  background: linear-gradient(#cfc7b8 0%, #fffdf8 42%, #fffdf8 58%, #e9e4da 100%);
  box-shadow:
    0 0 0 0.3cqw #c8c0b1,
    0 -0.5cqw 0.4cqw -0.1cqw rgba(60, 50, 36, 0.3);
  transform: perspective(12cqw) rotateX(14deg);
}

:root:not([data-theme="light"]) .wall-switch__rocker {
  background: linear-gradient(#aab3c0 0%, #cdd4de 42%, #cdd4de 58%, #7f8a9c 100%);
  box-shadow:
    0 0 0 0.3cqw #7a859a,
    0 0.7cqw 0.4cqw -0.1cqw rgba(3, 13, 34, 0.55);
}

.wall-switch__pilot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.3cqw;
  height: 0.7cqw;
  margin: -0.35cqw 0 0 -0.65cqw;
  border-radius: 0.35cqw;
  background: #c9c1b2;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}

:root:not([data-theme="light"]) .wall-switch__pilot {
  background: #ffb03a;
  box-shadow:
    0 0 0.8cqw 0.15cqw rgba(255, 176, 58, 0.9),
    0 0 2.4cqw 0.6cqw rgba(255, 176, 58, 0.35);
}

/* Lights off in the dark room: the lamp's glow goes with them. */

:root:not([data-theme="light"]) .room-light span {
  background: #6f86a8;
  box-shadow: none;
}

.chalkboard {
  position: absolute;
  left: 2%;
  top: 17%;
  width: 74%;
  height: 44%;
  padding: 2.6% 4%;
  border: 1.2cqw solid #b98a4e;
  border-top-color: #d4a96a;
  border-left-color: #cfa266;
  border-radius: 6px;
  background: radial-gradient(ellipse at 35% 30%, #1e3e70, #0b1e3c 78%);
  color: #f4f8fd;
  box-shadow:
    inset 0 0 0 3px #081b36,
    inset 0 0 30px rgba(0, 0, 0, 0.4),
    8px 12px 0 rgba(8, 27, 54, 0.6),
    14px 25px 30px rgba(3, 13, 34, 0.3);
  transform: translateZ(28px);
}

.chalkboard::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  pointer-events: none;
  background-image: repeating-linear-gradient(175deg, transparent 0 4px, rgba(233, 240, 250, 0.08) 5px, transparent 7px 13px);
}

.chalkboard__top {
  display: flex;
  justify-content: space-between;
  padding-bottom: 2.5%;
  border-bottom: 1px solid rgba(244, 248, 253, 0.22);
  font-size: 1.7cqw;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(244, 248, 253, 0.75);
}

.chalk-kana {
  display: block;
  margin-top: 1.5%;
  text-align: center;
  font-size: 2.4cqw;
  opacity: 0.75;
}

.chalk-word {
  display: block;
  text-align: center;
  font-size: 11cqw;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-shadow: 2px 1px 0 rgba(143, 178, 220, 0.45);
}

.chalk-meaning {
  display: block;
  text-align: center;
  font-size: 2.2cqw;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffd766;
}

.chalk-tray {
  position: absolute;
  left: -5%;
  bottom: -1.7cqw;
  width: 110%;
  height: 1.3cqw;
  border-radius: 2px;
  background: linear-gradient(#d4a96a, #8a6134);
  box-shadow:
    0 0.5cqw 0 #5c4026,
    0 1cqw 1cqw rgba(0, 0, 0, 0.3);
  transform: translateZ(15px);
}

.chalk-tray i,
.chalk-tray b {
  position: absolute;
  left: 15%;
  top: -0.5cqw;
  width: 3.2cqw;
  height: 0.5cqw;
  border-radius: 2px;
  background: #f4f8fd;
  transform: rotate(-4deg);
}

.chalk-tray b {
  left: 25%;
  width: 2.2cqw;
  background: #ffd766;
}

.chalk-tray > span {
  position: absolute;
  right: 14%;
  top: -1.5cqw;
  width: 4.5cqw;
  height: 1.6cqw;
  border-radius: 3px;
  background: linear-gradient(#f7be31 0 45%, #1e3e70 45%);
  box-shadow: 2px 1px 0 #081b36;
}

.room-floor {
  position: absolute;
  left: -5%;
  top: 70%;
  width: 112%;
  height: 39%;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(90deg, rgba(47, 95, 167, 0.35) 0 15%, rgba(143, 178, 220, 0.25) 15.1% 15.4%);
  box-shadow: 0 35px 40px rgba(2, 12, 34, 0.2);
  transform: rotateX(67deg);
}

:root[data-theme="light"] .room-floor {
  background: repeating-linear-gradient(90deg, rgba(95, 134, 182, 0.3) 0 15%, rgba(28, 61, 110, 0.18) 15.1% 15.4%);
}

.school-desk {
  position: absolute;
  left: 7%;
  bottom: 5%;
  width: 66%;
  height: 24%;
  transform-style: preserve-3d;
  transform: translateZ(70px);
}

.desk-top {
  position: absolute;
  left: 0;
  top: -20%;
  width: 100%;
  height: 60%;
  border: 2px solid #e2bd86;
  border-radius: 6px;
  background: repeating-linear-gradient(3deg, #d4a96a 0 6px, #c69a5e 7px 9px), #c69a5e;
  box-shadow: 0 10px 0 #8a6134;
  transform: rotateX(63deg);
}

.desk-front {
  position: absolute;
  left: 0;
  top: 22%;
  width: 100%;
  height: 23%;
  border-radius: 2px;
  background: linear-gradient(#b98a4e, #8a6134);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.school-desk > i,
.school-desk > b {
  position: absolute;
  top: 44%;
  left: 8%;
  width: 4%;
  height: 56%;
  background: linear-gradient(90deg, #1e3e70, #4273b8 40%, #12294e 70%);
  box-shadow: 4px 2px 0 #081b36;
  transform: rotate(-2deg);
}

.school-desk > b {
  left: auto;
  right: 8%;
  transform: rotate(2deg);
}

.kana-toy {
  position: absolute;
  pointer-events: auto;
  left: 41%;
  bottom: 27%;
  width: 12%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: #12294e;
  perspective: 500px;
  transform: translateZ(105px);
}

/* The button's own hit area, a little larger than the cube's picture. The cube
 * ignores the pointer, so lifting it on hover cannot slide it out from under
 * the mouse and flicker. */

.kana-toy::before {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 1.2cqw;
}

/* The cube paints over the button's own outline, so the focus ring goes on the
 * larger hit area around it instead, and keyboard focus gets the hover lift. */

.kana-toy:focus-visible {
  outline: none;
}

.kana-toy:focus-visible::before {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.kana-cube {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  transform-style: preserve-3d;
  transform: translateY(var(--toy-lift, 0px)) rotateX(-18deg) rotateY(calc(-25deg + var(--toy-turn, 0deg)));
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cube-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0.3cqw solid rgba(255, 255, 255, 0.65);
  border-radius: 0.8cqw;
  background: #f7be31;
  font: 900 7.2cqw/1 var(--ja);
  box-shadow: inset 0 0 0 2px rgba(18, 41, 78, 0.12);
  backface-visibility: hidden;
}

.cube-front {
  transform: translateZ(6cqw);
}

.cube-back {
  background: #7fa4d2;
  transform: rotateY(180deg) translateZ(6cqw);
}

.cube-right {
  background: #ffac88;
  transform: rotateY(90deg) translateZ(6cqw);
}

.cube-left {
  background: #8fd97a;
  transform: rotateY(-90deg) translateZ(6cqw);
}

.cube-top {
  background: #ffd766;
  transform: rotateX(90deg) translateZ(6cqw);
}

.cube-bottom {
  background: #edf5fd;
  transform: rotateX(-90deg) translateZ(6cqw);
}

/* Hover lifts the cube and lights its faces. Never filter, opacity < 1,
 * overflow or clip-path on .kana-cube (or any preserve-3d element): those
 * flatten it, and the cube turns into one flat square under the mouse. The
 * face wash is a box-shadow, which only paints. */

@media (hover: hover) {
  .kana-toy:hover .kana-cube {
    --toy-lift: -0.8cqw;
  }

  .kana-toy:hover .cube-face {
    border-color: #fff;
    box-shadow:
      inset 0 0 0 2px rgba(18, 41, 78, 0.12),
      inset 0 0 0 12cqw rgba(255, 255, 255, 0.14);
  }
}

.room-sensei {
  position: absolute;
  right: -1%;
  bottom: 0;
  width: 33%;
  pointer-events: none;
  filter: drop-shadow(0 18px 10px rgba(3, 13, 34, 0.35));
  transform: translateZ(130px) rotate(3deg);
}

/* ── The desk demo ──────────────────────────────────────────────────────── */

.lesson {
  background-color: var(--band);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px;
}

.lesson-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 460px) 240px;
  justify-content: space-between;
  align-items: start;
  gap: 36px;
  margin-top: 64px;
}

.lesson-aside {
  padding-top: 24px;
  text-align: center;
}

.lesson-aside img {
  width: 170px;
  margin: 0 auto;
  filter: drop-shadow(0 14px 10px rgba(3, 12, 29, 0.25));
}

/* Tall enough for Sensei's longest line, so a reaction never resizes the row. */

.speech {
  position: relative;
  min-height: 180px;
  margin-top: 20px;
  padding: 16px;
  border: 2px solid var(--rim);
  border-radius: 16px;
  background: var(--raised);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.speech::before {
  content: "";
  position: absolute;
  top: -9px;
  left: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--rim);
  border-left: 2px solid var(--rim);
  background: var(--raised);
  transform: rotate(45deg);
}

.lesson-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.deck {
  position: relative;
  perspective: 1400px;
}

.deck__under {
  position: absolute;
  inset: 12px 10px -12px;
  border-radius: 22px;
  background: var(--card-stack);
  transform: rotate(3deg);
}

.deck__under--far {
  inset: 16px 16px -18px;
  background: var(--card-deep);
  transform: rotate(-3.5deg);
}

.study-card {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 410px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.study-card.is-flipped {
  transform: rotateY(180deg);
}

.study-card.no-turn {
  transition: none;
}

.card-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 24px 24px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: var(--card);
  color: var(--on-card);
  text-align: center;
  box-shadow:
    0 6px 0 var(--card-deep),
    0 22px 40px var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-back {
  justify-content: center;
  transform: rotateY(180deg);
}

.card-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #ccdcf4;
}

.study-kana {
  margin-top: 28px;
  font-size: 18px;
  font-weight: 700;
  color: var(--on-card-soft);
}

.study-word {
  font-size: clamp(60px, 7vw, 88px);
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 4px 0 rgba(8, 27, 54, 0.18);
}

.study-romaji {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--on-card-mute);
}

.reveal-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding: 15px 18px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: var(--card-inner);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  transition: background 0.15s;
}

.reveal-btn:hover {
  background: var(--card-deep);
}

.reveal-btn span {
  font-size: 22px;
  line-height: 1;
}

.word-meaning {
  margin: 14px 0 18px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--gold);
}

.word-example-box {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card-inner);
}

.word-example {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.6;
}

.word-translation {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #ccdcf4;
}

.word-comment {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--on-card-soft);
}

.word-comment small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--gold);
}

/* The two answer buttons hold their place while hidden, so revealing them
 * never moves the card. */

.lesson-controls {
  display: flex;
  gap: 12px;
  height: 56px;
  margin-top: 30px;
}

.lesson-controls[hidden] {
  display: flex !important;
  visibility: hidden;
}

.answer {
  flex: 1;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 900;
  transition: transform 0.15s;
}

.answer:hover {
  transform: translateY(-2px);
}

.answer:active {
  transform: translateY(2px);
}

.answer--miss {
  border: 2px solid var(--rim);
  background: var(--raised);
  color: var(--miss);
  box-shadow: 0 4px 0 var(--rim-deep);
}

.answer--hit {
  border: 0;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--yellow-edge);
}

.noscript-note {
  margin-top: 16px;
  font-size: 14px;
}

.demo-bin {
  margin-top: 30px;
  padding: 20px;
  border: 2px dashed var(--rim);
  border-radius: 18px;
}

.bin-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
  color: var(--mute);
}

.bin-label > span:first-child {
  font-size: 20px;
  color: var(--text);
}

.bin-drawing {
  position: relative;
  width: 84px;
  height: 96px;
  margin: 30px auto 20px;
  border: 2px solid #7fa4d2;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: repeating-linear-gradient(90deg, #2f5fa7 0 12%, #4273b8 14%, #264e8d 19%);
  box-shadow: 8px 6px 0 rgba(8, 27, 54, 0.4);
  transform: perspective(500px) rotateY(-15deg) rotate(6deg);
}

.bin-drawing div {
  position: absolute;
  top: -12px;
  left: -9px;
  width: 100px;
  height: 14px;
  border-radius: 5px;
  background: linear-gradient(#7fa4d2, #2f5fa7);
  box-shadow: 0 3px 0 #1e3e70;
  transform: rotate(-7deg);
}

.bin-drawing div::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 35px;
  width: 28px;
  height: 9px;
  border: 3px solid #a9c1e6;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.demo-bin h3 {
  font-size: 22px;
  font-weight: 900;
}

#bin-message {
  min-height: 72px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--soft);
}

#bin-words {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
  min-height: 82px;
  margin-top: 10px;
}

#bin-words li {
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--card);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--card-deep);
  transform: rotate(-3deg);
}

#restart-lesson {
  margin-top: 8px;
}

#restart-lesson[hidden] {
  display: inline-block !important;
  visibility: hidden;
}

/* ── What's inside ──────────────────────────────────────────────────────── */

/* A star chart, not a card grid. The six features are the six stars of one
 * constellation, drawn as a bin. On desktop three notes sit either side, each
 * on the same row as its star, with a dotted leader running into the chart.
 * The chart stretches to the notes' height, so the stars are HTML sparkles
 * placed by percentage (they stay round) and the SVG lines use non-scaling
 * strokes. The rows are equal thirds, and a star sits at the middle of its
 * row, so it is always level with its note. The practice exams star is a
 * dashed ring on dashed lines: that corner of the bin is not drawn in yet.
 * Nothing here has a fill, a box or a 3D effect. */

.inside {
  background: var(--page-deep);
}

/* Where each star sits across the chart, as a fraction of its width. Both the
 * star and its note's leader read these, so moving a star keeps its leader
 * the right length. The SVG points repeat them (x 100): move the line too. */

.sky {
  --chart-w: 300px;
  --sky-gap: 56px;
  --x1: 0.14;
  --x2: 0.22;
  --x3: 0.3;
  --x4: 0.86;
  --x5: 0.78;
  --x6: 0.7;
  position: relative;
  margin-top: 56px;
}

.star:nth-of-type(1),
.sky-note:nth-child(1) { --x: var(--x1); --row: 1; }

.star:nth-of-type(2),
.sky-note:nth-child(2) { --x: var(--x2); --row: 2; }

.star:nth-of-type(3),
.sky-note:nth-child(3) { --x: var(--x3); --row: 3; }

.star:nth-of-type(4),
.sky-note:nth-child(4) { --x: var(--x4); --row: 1; }

.star:nth-of-type(5),
.sky-note:nth-child(5) { --x: var(--x5); --row: 2; }

.star:nth-of-type(6),
.sky-note:nth-child(6) { --x: var(--x6); --row: 3; }

.sky__chart {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--chart-w);
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 33%, var(--rim) 0 1px, transparent 1.6px),
    radial-gradient(circle at 36% 58%, var(--rim) 0 1px, transparent 1.6px),
    radial-gradient(circle at 63% 66%, var(--rim) 0 1px, transparent 1.6px),
    radial-gradient(circle at 44% 92%, var(--rim) 0 1px, transparent 1.6px),
    radial-gradient(circle at 92% 38%, var(--rim) 0 1px, transparent 1.6px),
    radial-gradient(circle at 6% 70%, var(--rim) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 3%, var(--rim) 0 1px, transparent 1.6px);
}

.sky__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
}

.sky__figure {
  stroke: var(--line);
  stroke-width: 2;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.sky__line {
  stroke: var(--rim);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* A star: a four-point sparkle (::before) on a soft yellow glow (::after).
 * Gold on navy; blue on a yellow halo when the lights are on. */

.star {
  --size: 22px;
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc((var(--row) - 0.5) * 100% / 3);
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
}

.star::before,
.star::after {
  content: "";
  position: absolute;
  inset: 0;
}

.star::after {
  z-index: -1;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 102, 0.5), transparent 62%);
}

:root[data-theme="light"] .star::after {
  background: radial-gradient(circle, rgba(247, 190, 49, 0.75), transparent 60%);
}

.star::before {
  background: var(--accent);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  transition: transform 0.2s;
}

.star b {
  position: absolute;
  top: calc(100% + 2px);
  right: calc(100% - 2px);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: var(--soft);
}

.star:nth-of-type(n + 4) b {
  right: auto;
  left: calc(100% - 2px);
}

.star--bin {
  --size: 32px;
}

.sky__notes {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--chart-w) minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(150px, 1fr));
  column-gap: var(--sky-gap);
}

.sky-note {
  position: relative;
  grid-row: var(--row);
  align-self: center;
}

.sky-note:nth-child(-n + 3) {
  grid-column: 1;
  text-align: right;
}

.sky-note:nth-child(n + 4) {
  grid-column: 3;
}

/* The leader: 10px off the text, across the gap and into the chart, stopping
 * 18px short of the star's centre. */

.sky-note::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  width: calc(var(--sky-gap) + var(--chart-w) * var(--x) - 28px);
  border-top: 2px dotted var(--rim);
  transition: border-color 0.2s;
}

.sky-note:nth-child(n + 4)::after {
  left: auto;
  right: calc(100% + 10px);
  width: calc(var(--sky-gap) + var(--chart-w) * (1 - var(--x)) - 28px);
}

.sky-note__name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.sky-note h3 {
  margin: 4px 0 6px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
}

.sky-note h3 .pill {
  margin-left: 6px;
  vertical-align: 3px;
}

.sky-note p {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--soft);
}

/* Point at a note and its star answers. Hover devices only, so a tap on a
 * phone never leaves a star stuck big. */

@media (hover: hover) {
  .sky-note:hover::after {
    border-top-color: var(--accent);
  }

  .sky:has(.sky-note:nth-child(1):hover) .star:nth-of-type(1)::before,
  .sky:has(.sky-note:nth-child(2):hover) .star:nth-of-type(2)::before,
  .sky:has(.sky-note:nth-child(3):hover) .star:nth-of-type(3)::before,
  .sky:has(.sky-note:nth-child(4):hover) .star:nth-of-type(4)::before,
  .sky:has(.sky-note:nth-child(5):hover) .star:nth-of-type(5)::before,
  .sky:has(.sky-note:nth-child(6):hover) .star:nth-of-type(6)::before {
    transform: scale(1.45);
  }
}

.inside__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

/* ── Levels ─────────────────────────────────────────────────────────────── */

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

.level-card {
  position: relative;
  display: block;
  padding: 22px;
  border: 2px solid var(--rim);
  border-radius: 18px;
  background: var(--raised);
  box-shadow: 0 4px 0 var(--rim-deep);
  transition:
    transform 0.18s,
    border-color 0.18s;
}

a.level-card:hover {
  transform: translateY(-3px);
  border-color: var(--yellow);
}

.level-card:first-child {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--yellow-edge);
}

.level-code {
  display: block;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.level-card:first-child .level-code {
  color: var(--ink);
}

.level-tag {
  position: absolute;
  top: 24px;
  right: 20px;
  max-width: 55%;
  text-align: right;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.level-card h3 {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 900;
}

.level-card p {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--soft);
}

.level-card:first-child p {
  color: #1c3d6e;
}

.level-card--locked {
  border-style: dashed;
  background: transparent;
  box-shadow: none;
}

.level-card--locked .level-code {
  color: var(--mute);
}

/* N0, Useless Anime Japanese (the app's Gomi Kami rung): the brand, so it gets
 * the whole last row, which also means no orphan at three, two or one
 * columns. But it is locked and must look it: dashed, roped off with
 * hatching, and a padlock in a dashed ring where the other cards have a tag. */

.level-card--n0 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 26px;
  padding: 24px 28px;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, var(--grid) 14px 17px);
}

.level-card--n0 .level-code {
  grid-column: 1;
  grid-row: 1 / span 3;
  font-size: 72px;
}

.level-kami,
.level-card--n0 h3,
.level-card--n0 p {
  grid-column: 2;
}

.level-kami {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.level-kami [lang="ja"] {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.level-card--n0 h3 {
  margin-top: 0;
  font-size: 26px;
  line-height: 1.25;
}

.level-card--n0 .level-tag {
  position: static;
  grid-column: 3;
  grid-row: 1 / span 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: none;
}

.level-lock {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 16px;
  border: 2px dashed var(--rim);
  border-radius: 50%;
}

/* ── Download ───────────────────────────────────────────────────────────── */

.cta {
  position: relative;
  overflow: hidden;
  padding: 110px 5% 100px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0, rgba(66, 115, 184, 0.45), transparent 60%),
    var(--band);
}

:root[data-theme="light"] .cta {
  background:
    radial-gradient(ellipse at 50% 0, rgba(247, 190, 49, 0.28), transparent 60%),
    var(--band);
}

.cta__lamp {
  width: 90px;
  height: 8px;
  margin: 0 auto 34px;
  border-radius: 50%;
  background: #fff2ac;
  box-shadow: 0 10px 44px 16px rgba(255, 215, 110, 0.25);
}

.cta__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.cta__title {
  margin-top: 16px;
  font-size: clamp(46px, 7vw, 96px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.cta .lead {
  max-width: 520px;
  margin: 22px auto 0;
}

.cta__actions {
  margin-top: 34px;
}

.cta__android {
  max-width: 440px;
  margin: 44px auto 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mute);
}

.waitlist {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}

.waitlist__input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 2px solid var(--rim);
  border-radius: 12px;
  background: var(--input);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.waitlist__input::placeholder {
  color: var(--mute);
}

.waitlist__input[aria-invalid="true"] {
  border-color: var(--red);
}

.waitlist__btn {
  padding: 0 20px;
  border: 2px solid var(--rim);
  border-radius: 12px;
  background: var(--raised);
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--rim-deep);
}

.waitlist__btn:hover {
  border-color: var(--yellow);
}

.waitlist__note {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mute);
}

.waitlist__note--bad {
  color: var(--miss);
}

.waitlist__note--good {
  color: var(--good);
}

.cta__mascot {
  position: absolute;
  left: 3%;
  bottom: -60px;
  width: 200px;
  transform: rotate(12deg);
}

/* ── Widths ─────────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr 1fr;
  }

  .hero__sub {
    font-size: 18px;
  }

  .lesson-layout {
    grid-template-columns: 160px minmax(0, 440px) 210px;
    gap: 24px;
  }

  .lesson-aside img {
    width: 140px;
  }

  .speech {
    min-height: 210px;
  }

  .sky {
    --chart-w: 240px;
    --sky-gap: 40px;
  }

  .sky-note h3 {
    font-size: 19px;
  }

  .sky-note p {
    font-size: 14px;
  }
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .classroom {
    width: min(580px, 100%);
    justify-self: center;
    margin-top: 20px;
  }

  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 210px;
    margin-top: 44px;
  }

  .lesson-aside {
    display: none;
  }

  /* The chart stacks on top and the notes become its key: left column the
   * left-hand stars, right column the right-hand ones. */

  .inside {
    display: flex;
    flex-direction: column;
  }

  .sky {
    display: contents;
  }

  .sky__chart {
    order: 1;
    position: relative;
    left: auto;
    width: min(250px, 100%);
    aspect-ratio: 5 / 6;
    margin: 40px auto 0;
    transform: none;
  }

  .sky__notes {
    order: 3;
  }

  .inside__foot {
    order: 4;
  }

  .sky__notes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    gap: 30px 36px;
    margin-top: 44px;
  }

  .sky-note {
    align-self: start;
  }

  .sky-note:nth-child(-n + 3) {
    text-align: left;
  }

  .sky-note:nth-child(n + 4) {
    grid-column: 2;
  }

  .sky-note::after {
    display: none;
  }

  /* Off the chart, each note carries its own star. */

  .sky-note__name::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 8px;
    vertical-align: -1px;
    background: var(--accent);
    clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  }

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

  .cta__mascot {
    display: none;
  }
}

@media (max-width: 580px) {
  .hero h1 {
    font-size: clamp(42px, 11.5vw, 64px);
  }

  .mobile-note__stamp { display: none; }

  .hero__enter { font-size: 19px; padding-inline: 20px; }

  .hero__eyebrow { font-size: 9px; letter-spacing: .1em; }

  .hero__sub {
    margin-top: 20px;
    font-size: 17px;
  }

  .lesson-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .study-card {
    min-height: 390px;
  }

  .demo-bin {
    display: grid;
    grid-template-columns: 1fr 76px;
    column-gap: 14px;
    margin-top: 0;
  }

  .demo-bin > * {
    grid-column: 1 / -1;
  }

  .demo-bin .bin-drawing {
    grid-column: 2;
    grid-row: 2 / span 2;
    width: 58px;
    height: 66px;
    margin: 24px 8px 0 auto;
  }

  .demo-bin .bin-drawing div {
    width: 72px;
    left: -7px;
  }

  .demo-bin .bin-drawing div::before {
    left: 22px;
    width: 22px;
  }

  .demo-bin h3,
  #bin-message {
    grid-column: 1;
  }

  .demo-bin h3 {
    margin-top: 18px;
  }

  .sky__chart {
    width: min(230px, 100%);
  }

  .sky__notes {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 24px;
    margin-top: 36px;
  }

  .sky-note:nth-child(n) {
    grid-column: 1;
    grid-row: auto;
  }

  .sky-note h3 {
    font-size: 19px;
  }

  .inside__foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .inside__foot .text-link {
    display: inline-block;
    margin: 6px 0 0;
  }

  .level-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .level-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 14px;
    padding: 18px;
  }

  .level-code {
    grid-row: 1 / span 3;
    align-self: center;
    font-size: 36px;
  }

  .level-tag {
    position: static;
    max-width: none;
    text-align: left;
  }

  .level-card h3 {
    margin-top: 4px;
    font-size: 18px;
  }

  .level-card p {
    font-size: 14px;
  }

  .level-card--n0 .level-code {
    grid-row: 1 / span 4;
    font-size: 36px;
  }

  .level-card--n0 .level-tag {
    grid-column: 2;
    grid-row: auto;
    flex-direction: row;
    gap: 6px;
  }

  .level-lock {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 0;
  }

  .level-kami {
    margin-top: 2px;
    font-size: 10px;
  }

  .level-kami [lang="ja"] {
    font-size: 12px;
  }

  .level-card--n0 h3 {
    font-size: 20px;
  }

  .cta {
    padding: 80px 6% 70px;
  }
}

@media (max-width: 380px) {
  .lesson-meta {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-scene {
    transform: rotateX(3deg) rotateY(-10deg);
  }
}
