/* Homepage Personalization V3: header, hero devices, and transformation motion. */
.action-label-compact {
  display: none;
}

.lesson-transformation {
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 0;
}

@media (min-width: 1041px) {
  .hero-actions [data-hero-demo-link] {
    display: none;
  }
}

@media (min-width: 761px) {
  .lesson-transformation .lesson-source {
    grid-column: 3;
    grid-row: 1;
  }

  .lesson-transformation .transfer-lines {
    grid-column: 2;
    grid-row: 1;
    transform: scaleX(-1);
  }

  .lesson-transformation .practice-result {
    grid-column: 1;
    grid-row: 1;
  }
}

.transformation-stage {
  display: flex;
  height: 584px;
  min-height: 584px;
  min-width: 0;
  flex-direction: column;
  padding: 18px 16px 20px;
  border: 1px solid rgba(185, 200, 220, 0.74);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 38px rgba(25, 43, 76, 0.07);
}

.transformation-stage .visual-label {
  min-height: 28px;
  margin-bottom: 16px;
  font-size: 20px;
}

.zoom-computer {
  position: relative;
  width: 100%;
  max-width: 390px;
  margin: auto;
  padding: 10px 10px 0;
  border: 5px solid #111923;
  border-bottom-width: 8px;
  border-radius: 16px 16px 10px 10px;
  background: #111923;
  box-shadow: 0 20px 30px rgba(12, 21, 38, 0.2);
}

.zoom-computer::after {
  position: absolute;
  right: 8%;
  bottom: -16px;
  left: 8%;
  height: 9px;
  border-radius: 2px 2px 10px 10px;
  background: linear-gradient(#727985, #303640);
  box-shadow: 0 5px 8px rgba(8, 12, 20, 0.16);
  content: "";
}

.computer-camera {
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #637083;
  transform: translateX(-50%);
}

.zoom-computer .lesson-window {
  display: grid;
  overflow: hidden;
  width: 100%;
  height: 354px;
  min-height: 0;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #111923;
  box-shadow: none;
  direction: rtl;
}

.zoom-computer .participant-column {
  display: grid;
}

.zoom-computer .participant-tile {
  border-radius: 9px;
}

.zoom-computer .participant-tile span {
  padding-block: 5px;
  font-size: 11px;
}

.zoom-computer .lesson-board {
  border-radius: 9px;
}

.zoom-computer .board-row {
  grid-template-columns: 28px 58px minmax(0, 1fr);
  gap: 4px;
  padding: 9px 7px;
}

.zoom-computer .board-icon {
  width: 27px;
  height: 27px;
}

.zoom-computer .board-icon svg {
  width: 20px;
}

.zoom-computer .board-label {
  font-size: 12px;
}

.zoom-computer .board-row b,
.zoom-computer .row-speaking b {
  font-size: 10px;
  white-space: normal;
}

.zoom-toolbar {
  display: grid;
  height: 45px;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 3px;
  color: #f5f7fb;
  direction: rtl;
}

.zoom-toolbar span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #cbd2dc;
  font-size: 7px;
  font-weight: 600;
  line-height: 1;
}

.zoom-toolbar span.is-active {
  color: #5bd686;
}

.zoom-toolbar svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.practice-phone-wrap {
  position: relative;
  display: flex;
  min-height: 456px;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.practice-phone {
  position: relative;
  width: min(238px, 86%);
  height: 454px;
  padding: 11px 8px 8px;
  border: 6px solid #161b23;
  border-radius: 32px;
  background: #0b0d11;
  box-shadow: 0 22px 35px rgba(12, 21, 38, 0.23);
}

.phone-island {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 50%;
  width: 56px;
  height: 15px;
  border-radius: 99px;
  background: #12161c;
  transform: translateX(-50%);
}

.practice-phone .practice-screen {
  height: 100%;
  min-height: 0;
  padding: 20px 10px 10px;
  overflow: hidden;
  border-radius: 21px;
}

.practice-phone .practice-topbar img {
  width: 68px;
}

.practice-phone .practice-progress {
  margin-block: 10px;
}

.practice-phone .lesson-pattern {
  padding: 7px 8px;
}

.practice-phone .question-title {
  margin: 9px 0 6px;
  font-size: 13px;
}

.practice-phone .answer {
  min-height: 30px;
  margin-top: 5px;
  padding: 4px 6px;
  font-size: 9px;
}

.practice-phone .practice-button {
  margin-top: 7px;
  padding: 6px;
}

.transformation-stage .built-note {
  min-height: 28px;
  margin: 12px 0 0;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1200px) {
  .lesson-transformation {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  }

  .transformation-stage {
    height: 530px;
    min-height: 530px;
    padding-inline: 12px;
  }

  .zoom-computer .lesson-window {
    height: 320px;
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .zoom-computer .board-row {
    grid-template-columns: 25px 47px minmax(0, 1fr);
    padding-inline: 5px;
  }

  .practice-phone-wrap {
    min-height: 426px;
  }

  .practice-phone {
    width: min(220px, 88%);
    height: 424px;
  }
}

@media (max-width: 1040px) {
  .header-inner {
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }

  .brand {
    width: 190px;
    order: 1;
  }

  .header-actions {
    order: 2;
    margin-inline-start: auto;
  }

  .header-trial {
    display: inline-flex;
  }

  .nav-toggle {
    position: relative;
    z-index: 102;
    display: flex;
    width: 48px;
    height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    order: 3;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }

  .nav-toggle span {
    width: 27px;
    height: 3px;
    border-radius: 99px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .site-nav {
    position: fixed;
    z-index: 101;
    top: var(--header-height);
    right: 0;
    left: 0;
    display: flex;
    visibility: hidden;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 24px 28px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 20px 34px rgba(18, 36, 73, 0.14);
    opacity: 0;
    transform: translateY(-12px);
    transition: none;
  }

  .nav-open .site-nav {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .site-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid #e5eaf1;
    font-size: 18px;
  }

  .site-nav a::after {
    display: none;
  }

  .lesson-transformation {
    grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  }

  .transformation-stage {
    height: 555px;
    min-height: 555px;
  }

  .zoom-computer .lesson-window {
    height: 350px;
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .practice-phone-wrap {
    min-height: 450px;
  }

  .practice-phone {
    width: 238px;
    height: 448px;
  }
}

@media (max-width: 760px) {
  .header-inner {
    gap: 5px;
  }

  .brand {
    width: min(39vw, 145px);
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions .button {
    width: 54px;
    min-width: 54px;
    min-height: 48px;
    padding: 5px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1;
  }

  .header-actions .header-trial {
    width: 60px;
    min-width: 60px;
  }

  .action-label-full {
    display: none;
  }

  .action-label-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  .nav-toggle {
    width: 44px;
    height: 48px;
    flex: 0 0 44px;
  }

  .hero-inner {
    padding-top: 32px;
  }

  .lesson-transformation {
    display: grid;
    max-width: 430px;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .transformation-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 18px 14px 22px;
  }

  .lesson-source {
    min-height: 405px;
  }

  .zoom-computer {
    max-width: 344px;
  }

  .zoom-computer .lesson-window {
    display: grid;
    height: 250px;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 6px;
  }

  .zoom-computer .participant-column {
    display: grid;
  }

  .zoom-computer .participant-tile span {
    font-size: 9px;
  }

  .zoom-computer .board-row {
    min-height: 0;
    grid-template-columns: 23px 44px minmax(0, 1fr);
    gap: 3px;
    padding: 6px 4px;
    border: 0;
    border-bottom: 1px solid #e6ebf1;
    border-radius: 0;
    box-shadow: none;
  }

  .zoom-computer .board-label {
    font-size: 10px;
  }

  .zoom-computer .board-row b,
  .zoom-computer .row-speaking b {
    font-size: 8px;
  }

  .zoom-toolbar {
    height: 38px;
  }

  .zoom-toolbar span {
    font-size: 0;
  }

  .zoom-toolbar svg {
    width: 18px;
    height: 18px;
  }

  .transfer-lines {
    width: 48px;
    height: 54px;
    margin: 3px auto;
    transform: rotate(90deg);
  }

  .practice-result {
    min-height: 570px;
  }

  .practice-phone-wrap {
    min-height: 462px;
  }

  .practice-phone {
    width: 250px;
    max-width: 82vw;
    height: 462px;
  }

}

@media (max-width: 420px) {
  .header-inner {
    width: min(calc(100% - 20px), var(--container));
  }

  .brand {
    width: 145px;
  }

  .header-actions .button,
  .header-actions .header-trial {
    min-height: 46px;
  }

  .lesson-source {
    min-height: 390px;
  }

  .zoom-computer .lesson-window {
    height: 238px;
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

@media (max-width: 350px) {
  .brand {
    width: 112px;
  }

  .header-actions .button {
    width: 47px;
    min-width: 47px;
    font-size: 12px;
  }

  .header-actions .header-trial {
    width: 52px;
    min-width: 52px;
  }

  .nav-toggle {
    width: 40px;
    flex-basis: 40px;
  }

  .nav-toggle span {
    width: 24px;
  }

  .lesson-source {
    min-height: 330px;
  }

  .zoom-computer .lesson-window {
    height: 200px;
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .zoom-computer .board-row b,
  .zoom-computer .row-speaking b {
    font-size: 8.5px;
  }
}

/* Selected V3 motion: shared device and responsive composition scaffold. */
.lesson-transformation {
  position: relative;
  isolation: isolate;
}

.transformation-stage {
  overflow: visible;
}

.laptop-shell {
  width: 100%;
  max-width: 410px;
  margin: 84px auto 24px;
}

.laptop-shell::after {
  display: none;
  content: none;
}

.laptop-shell .lesson-window {
  height: 228px;
  min-height: 0;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 6px;
}

.laptop-shell .participant-column {
  min-height: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  overflow: hidden;
}

.laptop-shell .participant-tile,
.laptop-shell .participant-tile .avatar,
.laptop-shell .lesson-board,
.laptop-shell .board-row {
  min-height: 0;
}

.laptop-shell .participant-tile {
  overflow: hidden;
}

.laptop-shell .participant-tile .avatar {
  width: 100%;
  height: calc(100% - 18px);
  flex: 1 1 auto;
}

.laptop-shell .participant-tile span {
  flex: 0 0 auto;
  padding-block: 3px;
  font-size: 8px;
}

.laptop-shell .lesson-board {
  grid-template-rows: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.laptop-shell .board-row {
  overflow: hidden;
  grid-template-columns: 24px 48px minmax(0, 1fr);
  gap: 4px;
  padding: 5px;
}

.laptop-shell .board-icon {
  width: 23px;
  height: 23px;
}

.laptop-shell .board-icon svg {
  width: 17px;
}

.laptop-shell .board-label {
  font-size: 10px;
}

.laptop-shell .board-row b,
.laptop-shell .row-speaking b {
  font-size: 8.5px;
  line-height: 1.16;
  white-space: normal;
}

.laptop-shell .zoom-toolbar {
  height: 40px;
}

.laptop-base {
  position: absolute;
  z-index: 0;
  bottom: -24px;
  left: 50%;
  display: block;
  width: calc(100% + 36px);
  max-width: calc(100vw - 32px);
  height: 21px;
  border-radius: 3px 3px 13px 13px;
  background: linear-gradient(180deg, #9098a5 0%, #555e6a 46%, #2e3540 100%);
  box-shadow: 0 8px 12px rgba(8, 12, 20, 0.2);
  clip-path: polygon(2% 0, 98% 0, 100% 72%, 96% 100%, 4% 100%, 0 72%);
  transform: translateX(-50%);
}

.laptop-base::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 22%;
  height: 4px;
  border-radius: 0 0 6px 6px;
  background: rgba(27, 34, 44, 0.52);
  content: "";
  transform: translateX(-50%);
}

.laptop-base::after {
  position: absolute;
  right: 7%;
  bottom: 2px;
  left: 7%;
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  content: "";
}

.transfer-lines {
  height: 300px;
}

.mobile-transfer-lines {
  display: none;
}

.transfer-lines .desktop-arrow,
.transfer-lines .desktop-transfer-shaft,
.transfer-lines .desktop-transfer-tip {
  display: block;
}

@media (max-width: 1200px) {
  .laptop-shell .lesson-window {
    height: 214px;
  }
}

/* One compact canvas keeps source, transfer, and result in view together. */
@media (max-width: 700px) {
  .hero-inner {
    padding-top: 32px;
  }

  .lesson-transformation {
    display: block;
    width: 100%;
    max-width: 430px;
    height: 556px;
    margin: 18px auto 0;
    overflow: hidden;
    border: 1px solid rgba(185, 200, 220, 0.78);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 14px 38px rgba(25, 43, 76, 0.08);
  }

  .lesson-transformation .transformation-stage {
    position: absolute;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .lesson-transformation .lesson-source {
    z-index: 2;
    top: 16px;
    right: 12px;
    left: auto;
    width: min(292px, calc(100% - 48px));
  }

  .lesson-source .visual-label {
    min-height: 23px;
    margin: 0 0 7px;
    font-size: 16px;
    text-align: right;
  }

  .laptop-shell {
    width: 100%;
    max-width: 282px;
    margin: 0;
    padding: 7px 7px 0;
    border-width: 4px;
    border-bottom-width: 6px;
    border-radius: 12px 12px 8px 8px;
  }

  .laptop-shell .lesson-window {
    height: 164px;
    grid-template-columns: 65px minmax(0, 1fr);
    gap: 4px;
  }

  .laptop-shell .participant-column {
    gap: 4px;
  }

  .laptop-shell .participant-tile {
    border-radius: 6px;
  }

  .laptop-shell .participant-tile .avatar {
    height: calc(100% - 13px);
  }

  .laptop-shell .participant-tile span {
    padding-block: 2px;
    font-size: 7px;
  }

  .laptop-shell .lesson-board {
    gap: 0;
    border-radius: 6px;
    background: #fff;
  }

  .laptop-shell .board-row {
    grid-template-columns: 18px 34px minmax(0, 1fr);
    gap: 2px;
    padding: 4px 3px;
    border: 0;
    border-bottom: 1px solid #e6ebf1;
    border-radius: 0;
    box-shadow: none;
  }

  .laptop-shell .board-icon {
    width: 18px;
    height: 18px;
  }

  .laptop-shell .board-icon svg {
    width: 14px;
  }

  .laptop-shell .board-label {
    font-size: 8px;
  }

  .laptop-shell .board-row b,
  .laptop-shell .row-speaking b {
    font-size: 6.6px;
    line-height: 1.18;
  }

  .laptop-shell .zoom-toolbar {
    height: 30px;
  }

  .laptop-shell .zoom-toolbar svg {
    width: 14px;
    height: 14px;
  }

  .laptop-shell .zoom-toolbar span {
    font-size: 0;
  }

  .laptop-base {
    bottom: -19px;
    width: calc(100% + 28px);
    height: 17px;
  }

  .lesson-transformation .practice-result {
    z-index: auto;
    right: auto;
    left: 8px;
    bottom: 14px;
    width: 174px;
  }

  .practice-result .visual-label {
    position: relative;
    z-index: 8;
    min-height: 22px;
    margin: 0 0 4px;
    padding: 3px 7px;
    border: 1px solid rgba(185, 200, 220, 0.76);
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 15px rgba(18, 36, 73, 0.13);
    font-size: 15px;
    text-align: center;
  }

  .practice-phone-wrap {
    z-index: 5;
    min-height: 0;
    height: 305px;
  }

  .practice-phone {
    width: 158px;
    max-width: none;
    height: 302px;
    padding: 8px 5px 5px;
    border-width: 4px;
    border-radius: 24px;
    box-shadow: 0 17px 28px rgba(12, 21, 38, 0.24);
  }

  .phone-island {
    top: 3px;
    width: 42px;
    height: 10px;
  }

  .practice-phone .practice-screen {
    padding: 14px 6px 6px;
    border-radius: 16px;
  }

  .practice-phone .practice-topbar {
    padding-bottom: 4px;
    font-size: 7px;
  }

  .practice-phone .practice-topbar img {
    width: 48px;
  }

  .lesson-transformation .built-note {
    position: absolute;
    z-index: 7;
    top: 196px;
    right: auto;
    left: calc(100% + 6px);
    bottom: auto;
    width: 158px;
    min-height: 20px;
    margin: 0;
    padding: 5px 6px;
    gap: 4px;
    border: 1px solid rgba(185, 200, 220, 0.72);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(18, 36, 73, 0.1);
    box-sizing: border-box;
    color: #52617a;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }

  .lesson-transformation .built-note svg {
    width: 14px;
  }

  .lesson-transformation .transfer-lines {
    display: none;
  }

  .lesson-transformation .mobile-transfer-lines {
    position: absolute;
    z-index: 6;
    top: 278px;
    right: 14px;
    left: auto;
    display: block;
    width: 160px;
    height: 180px;
    margin: 0;
    overflow: visible;
    pointer-events: none;
  }
}

@media (max-width: 350px) {
  .lesson-transformation {
    height: 534px;
  }

  .lesson-transformation .lesson-source {
    right: 8px;
    left: auto;
    width: 242px;
  }

  .laptop-shell {
    max-width: 242px;
  }

  .laptop-shell .lesson-window {
    height: 148px;
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .lesson-transformation .practice-result {
    right: auto;
    left: 5px;
    width: 148px;
  }

  .practice-phone-wrap {
    height: 279px;
  }

  .practice-phone {
    width: 138px;
    height: 277px;
  }

  .lesson-transformation .built-note {
    top: 166px;
    right: auto;
    left: calc(100% + 3px);
    width: 120px;
    font-size: 9px;
  }

  .lesson-transformation .mobile-transfer-lines {
    top: 258px;
    right: -6px;
    left: auto;
    width: 134px;
    height: 160px;
  }
}

/* Authentic five-stage lesson progress: one calm path, without segmented artifacts. */
.practice-phone .practice-progress {
  --practice-stage-marker-size: 16px;
  position: relative;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.practice-phone .practice-progress::before {
  position: absolute;
  z-index: 0;
  top: calc(var(--practice-stage-marker-size) / 2);
  right: 10%;
  left: 10%;
  content: "";
  height: 1px;
  background: #c5d8e9;
}

.practice-phone .practice-progress li {
  z-index: 1;
  min-width: 0;
}

.practice-phone .practice-progress li::before {
  z-index: 2;
  width: var(--practice-stage-marker-size);
  height: var(--practice-stage-marker-size);
  content: "";
}

.practice-phone .practice-progress li.is-done::before {
  border-color: #69afe4;
  background: #eaf7ff;
  color: var(--blue);
  content: "✓";
}

.practice-phone .practice-progress li.is-current::before {
  content: "4";
}

.practice-phone .practice-progress li:nth-child(5)::before {
  content: "5";
}

.practice-phone .practice-progress li::after {
  display: none;
  content: none;
}

/* Completed/no-JS presentation is the default; JavaScript only arms the idle state. */
.motion-sentinel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.lesson-transformation .transfer-lines path.transfer-shaft,
.lesson-transformation .transfer-lines path.transfer-tip {
  opacity: 1;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
}

.lesson-transformation .transfer-lines path[data-arrow="1"],
.lesson-transformation .transfer-lines path[data-arrow="2"] {
  stroke: var(--blue);
}

.lesson-transformation .transfer-lines path[data-arrow="3"],
.lesson-transformation .transfer-lines path[data-arrow="4"] {
  stroke: var(--purple);
}

.lesson-transformation .transfer-lines path.desktop-arrow {
  stroke-width: 3.2;
}

.lesson-transformation .mobile-transfer-lines [data-arrow="1"],
.lesson-transformation .mobile-transfer-lines [data-arrow="2"] {
  color: var(--blue);
}

.lesson-transformation .mobile-transfer-lines [data-arrow="3"],
.lesson-transformation .mobile-transfer-lines [data-arrow="4"] {
  color: var(--purple);
}

.lesson-transformation .mobile-transfer-shaft {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.lesson-transformation .mobile-transfer-head {
  fill: currentColor;
  stroke: none;
  stroke-linejoin: round;
  transform: scale(1);
  transform-box: fill-box;
  transform-origin: center;
  vector-effect: non-scaling-stroke;
}

.lesson-transformation [data-phone-module],
.lesson-transformation .practice-button,
.lesson-transformation .built-note {
  opacity: 1;
  transform: none;
}

.practice-phone {
  --phone-rest-shadow: 0 22px 35px rgba(12, 21, 38, 0.23);
  --phone-halo-shadow:
    0 0 0 7px rgba(38, 143, 219, 0.14),
    0 0 34px 7px rgba(128, 80, 218, 0.25);
  --phone-settled-shadow:
    0 0 0 2px rgba(38, 143, 219, 0.08),
    0 0 22px 2px rgba(128, 80, 218, 0.14);
  isolation: isolate;
  box-shadow: var(--phone-rest-shadow);
}

.practice-phone::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--phone-settled-shadow);
  content: "";
  pointer-events: none;
}

.lesson-transformation.motion-is-idle .transfer-lines path.transfer-shaft,
.lesson-transformation.motion-is-idle .transfer-lines path.transfer-tip,
.lesson-transformation.motion-is-playing .transfer-lines path.transfer-shaft,
.lesson-transformation.motion-is-playing .transfer-lines path.transfer-tip {
  opacity: 0;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.lesson-transformation.motion-is-idle .mobile-transfer-shaft,
.lesson-transformation.motion-is-playing .mobile-transfer-shaft {
  opacity: 0;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  stroke-linecap: butt;
}

.lesson-transformation.motion-is-idle .mobile-transfer-head,
.lesson-transformation.motion-is-playing .mobile-transfer-head {
  opacity: 0;
  transform: scale(0.78);
}

.lesson-transformation.motion-is-idle [data-phone-module],
.lesson-transformation.motion-is-idle .practice-button,
.lesson-transformation.motion-is-playing [data-phone-module],
.lesson-transformation.motion-is-playing .practice-button {
  opacity: 0.12;
  transform: none;
}

.lesson-transformation.motion-is-idle .built-note {
  opacity: 0.48;
}

.lesson-transformation.motion-is-idle .practice-phone::after {
  box-shadow: 0 0 0 0 rgba(38, 143, 219, 0), 0 0 0 0 rgba(128, 80, 218, 0);
}

.lesson-transformation.motion-is-playing .transfer-shaft[data-arrow="1"] {
  animation: selected-arrow-shaft 1300ms cubic-bezier(0.4, 0, 0.2, 1) 120ms both;
}

.lesson-transformation.motion-is-playing .transfer-tip[data-arrow="1"] {
  animation: selected-arrow-tip 420ms cubic-bezier(0.4, 0, 0.2, 1) 1150ms both;
}

.lesson-transformation.motion-is-playing .transfer-shaft[data-arrow="2"] {
  animation: selected-arrow-shaft 1300ms cubic-bezier(0.4, 0, 0.2, 1) 120ms both;
}

.lesson-transformation.motion-is-playing .transfer-tip[data-arrow="2"] {
  animation: selected-arrow-tip 420ms cubic-bezier(0.4, 0, 0.2, 1) 1150ms both;
}

.lesson-transformation.motion-is-playing .transfer-shaft[data-arrow="3"] {
  animation: selected-arrow-shaft 1300ms cubic-bezier(0.4, 0, 0.2, 1) 120ms both;
}

.lesson-transformation.motion-is-playing .transfer-tip[data-arrow="3"] {
  animation: selected-arrow-tip 420ms cubic-bezier(0.4, 0, 0.2, 1) 1150ms both;
}

.lesson-transformation.motion-is-playing .transfer-shaft[data-arrow="4"] {
  animation: selected-arrow-shaft 1300ms cubic-bezier(0.4, 0, 0.2, 1) 120ms both;
}

.lesson-transformation.motion-is-playing .transfer-tip[data-arrow="4"] {
  animation: selected-arrow-tip 420ms cubic-bezier(0.4, 0, 0.2, 1) 1150ms both;
}

.lesson-transformation.motion-is-playing [data-phone-module="grammar"] {
  animation: selected-module-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 850ms both;
}

.lesson-transformation.motion-is-playing [data-phone-module="sentence"] {
  animation: selected-module-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 1500ms both;
}

.lesson-transformation.motion-is-playing .practice-button {
  animation: selected-module-in 700ms cubic-bezier(0.22, 1, 0.36, 1) 2150ms both;
}

.lesson-transformation.motion-is-playing .built-note {
  animation: selected-note-emphasis 850ms cubic-bezier(0.22, 1, 0.36, 1) 3000ms both;
}

.lesson-transformation.motion-is-playing .practice-phone::after {
  animation: selected-phone-halo 2500ms cubic-bezier(0.4, 0, 0.2, 1) 1570ms both;
}

.lesson-transformation.motion-is-playing .motion-sentinel {
  animation: selected-motion-finish 1ms linear 4069ms both;
}

.lesson-transformation.motion-is-complete .transfer-lines path.transfer-shaft,
.lesson-transformation.motion-is-complete .transfer-lines path.transfer-tip {
  opacity: 1;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
}

.lesson-transformation.motion-is-complete .mobile-transfer-shaft {
  opacity: 1;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
}

.lesson-transformation.motion-is-complete .mobile-transfer-head {
  opacity: 1;
  transform: scale(1);
}

.lesson-transformation.motion-is-complete [data-phone-module],
.lesson-transformation.motion-is-complete .practice-button,
.lesson-transformation.motion-is-complete .built-note {
  opacity: 1;
  transform: none;
}

.lesson-transformation.motion-is-complete .practice-phone::after {
  box-shadow: var(--phone-settled-shadow);
}

@keyframes selected-arrow-shaft {
  0% { opacity: 0; stroke-dashoffset: 1; }
  2%, 100% { opacity: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes selected-arrow-tip {
  0% { opacity: 0; stroke-dashoffset: 1; }
  2%, 100% { opacity: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes selected-module-in {
  from { opacity: 0.12; }
  to { opacity: 1; }
}

@keyframes selected-note-emphasis {
  from { opacity: 0.48; color: #52617a; transform: translateY(4px); }
  58% { opacity: 1; color: var(--purple); transform: translateY(0); }
  to { opacity: 1; color: #52617a; transform: translateY(0); }
}

@keyframes selected-phone-halo {
  from { box-shadow: 0 0 0 0 rgba(38, 143, 219, 0), 0 0 0 0 rgba(128, 80, 218, 0); }
  18%, 80% { box-shadow: var(--phone-halo-shadow); }
  to { box-shadow: var(--phone-settled-shadow); }
}

@keyframes selected-motion-finish {
  from { opacity: 0; }
  to { opacity: 0.01; }
}

@media (max-width: 700px) {
  .lesson-transformation.motion-is-idle .practice-phone-wrap,
  .lesson-transformation.motion-is-idle .practice-result > .visual-label,
  .lesson-transformation.motion-is-playing .practice-phone-wrap,
  .lesson-transformation.motion-is-playing .practice-result > .visual-label,
  .lesson-transformation.motion-is-complete .practice-phone-wrap,
  .lesson-transformation.motion-is-complete .practice-result > .visual-label {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .lesson-transformation.motion-is-idle .transfer-lines path.transfer-shaft,
  .lesson-transformation.motion-is-idle .transfer-lines path.transfer-tip,
  .lesson-transformation.motion-is-playing .transfer-lines path.transfer-shaft,
  .lesson-transformation.motion-is-playing .transfer-lines path.transfer-tip,
  .lesson-transformation.motion-is-idle .mobile-transfer-shaft,
  .lesson-transformation.motion-is-playing .mobile-transfer-shaft {
    opacity: 1;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none !important;
  }

  .lesson-transformation.motion-is-idle .mobile-transfer-head,
  .lesson-transformation.motion-is-playing .mobile-transfer-head {
    opacity: 1;
    transform: scale(1);
    animation: none !important;
  }

  .lesson-transformation.motion-is-idle [data-phone-module],
  .lesson-transformation.motion-is-idle .practice-button,
  .lesson-transformation.motion-is-idle .built-note,
  .lesson-transformation.motion-is-playing [data-phone-module],
  .lesson-transformation.motion-is-playing .practice-button,
  .lesson-transformation.motion-is-playing .built-note {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .lesson-transformation.motion-is-idle .practice-phone::after,
  .lesson-transformation.motion-is-playing .practice-phone::after {
    box-shadow: var(--phone-settled-shadow);
    animation: none !important;
  }

  .lesson-transformation .motion-sentinel {
    animation: none !important;
  }

  .practice-phone .practice-progress {
    --practice-stage-marker-size: 12px;
    gap: 0;
    margin-block: 6px;
  }

  .practice-phone .practice-progress::before {
    top: calc(var(--practice-stage-marker-size) / 2);
  }

  .practice-phone .practice-progress li {
    padding-top: 15px;
    font-size: 6.2px;
    line-height: 1.1;
  }

  .practice-phone .practice-progress li::before {
    font-size: 7px;
  }

  .practice-phone {
    --phone-rest-shadow: 0 17px 28px rgba(12, 21, 38, 0.24);
    --phone-halo-shadow:
      0 0 0 3px rgba(38, 143, 219, 0.13),
      0 0 11px 1px rgba(128, 80, 218, 0.24);
    --phone-settled-shadow:
      0 0 0 1px rgba(38, 143, 219, 0.08),
      0 0 7px 1px rgba(128, 80, 218, 0.13);
  }

}

@media (max-width: 350px) {
  .practice-phone .practice-screen {
    padding: 12px 6px 5px;
  }

  .practice-phone .practice-topbar {
    padding-bottom: 2px;
  }

  .practice-phone .practice-progress {
    margin-block: 4px;
  }

  .practice-phone .practice-progress li {
    font-size: 5.6px;
  }

  .practice-phone .lesson-pattern {
    padding: 4px 5px;
  }

  .practice-phone .lesson-pattern small {
    font-size: 7px;
  }

  .practice-phone .lesson-pattern strong {
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.15;
  }

  .practice-phone .question-title {
    margin: 5px 0 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  .practice-phone .answer {
    min-height: 26px;
    margin-top: 3px;
    padding: 2px 3px;
    font-size: 8px;
    line-height: 1.2;
  }

  .practice-phone .answer svg {
    width: 10px;
  }

  .practice-phone .practice-button {
    margin-top: 4px;
    padding: 4px;
    font-size: 9px;
  }

  .practice-phone {
    --phone-halo-shadow:
      0 0 0 2px rgba(38, 143, 219, 0.12),
      0 0 7px rgba(128, 80, 218, 0.22);
    --phone-settled-shadow:
      0 0 0 1px rgba(38, 143, 219, 0.07),
      0 0 4px rgba(128, 80, 218, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-transformation.motion-is-idle *,
  .lesson-transformation.motion-is-playing * {
    animation: none !important;
  }

  .lesson-transformation.motion-is-idle .transfer-lines path.transfer-shaft,
  .lesson-transformation.motion-is-idle .transfer-lines path.transfer-tip,
  .lesson-transformation.motion-is-playing .transfer-lines path.transfer-shaft,
  .lesson-transformation.motion-is-playing .transfer-lines path.transfer-tip {
    opacity: 1;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  .lesson-transformation.motion-is-idle .mobile-transfer-shaft,
  .lesson-transformation.motion-is-playing .mobile-transfer-shaft {
    opacity: 1;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  .lesson-transformation.motion-is-idle .mobile-transfer-head,
  .lesson-transformation.motion-is-playing .mobile-transfer-head {
    opacity: 1;
    transform: scale(1);
  }

  .lesson-transformation.motion-is-idle [data-phone-module],
  .lesson-transformation.motion-is-idle .practice-button,
  .lesson-transformation.motion-is-idle .built-note,
  .lesson-transformation.motion-is-idle .practice-phone-wrap,
  .lesson-transformation.motion-is-idle .practice-result > .visual-label,
  .lesson-transformation.motion-is-playing [data-phone-module],
  .lesson-transformation.motion-is-playing .practice-button,
  .lesson-transformation.motion-is-playing .built-note,
  .lesson-transformation.motion-is-playing .practice-phone-wrap,
  .lesson-transformation.motion-is-playing .practice-result > .visual-label {
    opacity: 1;
    transform: none;
  }

  .lesson-transformation.motion-is-idle .practice-phone::after,
  .lesson-transformation.motion-is-playing .practice-phone::after {
    box-shadow: var(--phone-settled-shadow);
  }
}
