/* How it works: approved layout, examples and decorative background. */
body:is([data-page="how"], [data-page="subscription"]) {
  --reading-width: 640px;
  --reading-offset: 187px;
  position: relative;
  display: flow-root;
  min-height: 100vh;
  background: #342417;
}
.how-surface {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100vh - 88px);
  background: #342417;
}
.how-surface::before {
  content: "";
  position: absolute;
  inset: -28px;
  z-index: -2;
  pointer-events: none;
  background: url('home-scene.webp') center top / 100% auto no-repeat;
  filter: blur(24px);
  clip-path: inset(28px);
}
.how-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, #21180ee0, #21180eb8);
}
body:is([data-page="how"], [data-page="subscription"]) main { position: relative; }
.step { padding: 43px 0 45px; border: 0; }
.step:first-child { padding-bottom: 24px; }
.step + .step { position: relative; margin-top: 28px; }
.step-copy {
  position: relative;
  isolation: isolate;
  display: block;
  margin-left: var(--reading-offset);
  max-width: var(--reading-width);
}
.step-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: -28px -30px -28px -62px;
  border-radius: 15px;
  background: linear-gradient(135deg, #8c684125, #76513618);
  box-shadow: 0 12px 30px #160e080a;
}
.step .step-title {
  position: relative;
  font: 650 clamp(24px, 3vw, 32px)/1.3 Manrope, Arial, sans-serif;
  letter-spacing: -.035em;
  margin: 0 0 16px;
  max-width: 700px;
}
.step-number { position: absolute; right: calc(100% + .35em); white-space: nowrap; }
.step p { margin: 0 0 18px; color: var(--muted); max-width: 770px; }
.step-copy > p:last-child, .step:first-child .step-copy > p { margin-bottom: 0; }
.step:first-child .step-copy > .button {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 24px auto 0;
}
body:is([data-page="how"], [data-page="subscription"]) .button.pp-install {
  position: relative;
  left: -20px;
  align-self: center;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  padding: 18px 28px;
  border: 1px solid #ffb27a44;
  border-radius: 7px;
  background: #f45a19;
  color: #fffaf4;
  font: 800 28px/1.2 Manrope, Arial, sans-serif;
  letter-spacing: -1.15px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 5px 25px #2a130b30;
  transition: background .2s;
}
body:is([data-page="how"], [data-page="subscription"]) .button.pp-install:hover { background: #d94608; }
.prompt.prompt-composer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 10px 10px 10px 20px;
  min-height: 68px;
  max-width: 770px;
  margin: 4px 0 24px;
  border: 1px solid #fff8ed1c;
  border-radius: 999px;
  background: #3a2d23;
  box-shadow: inset 0 1px 0 #fff8ed03;
}
.prompt.prompt-composer p {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: left;
  color: #eee0cd;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: normal;
}
.composer-plus { display: flex; flex: none; color: #fff1df; }
.composer-plus svg { width: 23px; height: 23px; }
.composer-controls { display: flex; align-items: center; gap: 17px; flex: none; color: #e8d7bf; }
.composer-reasoning {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 400 15px/1.4 'Golos Text', Arial, sans-serif;
  white-space: nowrap;
  color: #c9b9a5;
}
.composer-reasoning svg { width: 15px; height: 15px; }
.composer-microphone { display: flex; }
.composer-microphone svg { width: 23px; height: 23px; }
.composer-voice {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: #174bb5;
  color: #fff8ed;
}
.composer-voice svg { width: 24px; height: 24px; }
.reference {
  margin-left: var(--reading-offset);
  max-width: var(--reading-width);
  padding: 68px 0 64px;
  border: 0;
}
.reference > h2 {
  font: 650 clamp(28px, 4vw, 43px)/1.2 Manrope, Arial, sans-serif;
  letter-spacing: -.045em;
  margin: 0 0 34px;
}
.accordion { border-top: 1px solid var(--line); }
.accordion > details { border-bottom: 1px solid var(--line); }
.accordion summary {
  position: relative;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  cursor: pointer;
  padding: 23px 0;
  font-size: 20px;
  font-weight: 500;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--peach); }
.accordion summary::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #c9b9a5;
  border-bottom: 1.5px solid #c9b9a5;
  transform: translateY(-50%) rotate(-45deg);
  transition: transform .25s ease, border-color .2s;
}
.accordion details[open] summary::before { transform: translateY(-65%) rotate(45deg); }
.accordion summary:hover::before { border-color: #fff8ed; }
.accordion summary::after {
  content: "";
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  margin-right: 15px;
  background: url('mandarin-icon.webp') center / contain no-repeat;
  transition: transform .25s ease;
}
.accordion details[open] summary::after { transform: rotate(-18deg); }
.detail-body { color: var(--muted); max-width: 640px; padding: 0 0 9px; }
.detail-body > p { margin: 0 0 17px; }
.detail-body .prompt { max-width: 100%; margin-bottom: 20px; }
.closing {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  margin-left: var(--reading-offset);
  max-width: var(--reading-width);
  margin-bottom: 70px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.closing .button { flex-shrink: 0; width: fit-content; max-width: 100%; }
.how-foliage-top {
  position: absolute;
  top: -3px;
  right: -3px;
  width: clamp(180px, calc((100vw - 640px)/2 + 12px), 640px);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  transform-origin: top right;
  animation: how-leaf-breeze 9s ease-in-out infinite;
}
.how-foliage-top img { display: block; width: 100%; height: auto; transform: scaleY(-1); }
@keyframes how-leaf-breeze {
  0%, 100% { transform: rotate(-.7deg); }
  50% { transform: rotate(1deg); }
}
@media (max-width: 1100px) {
  .how-foliage-top { width: clamp(55px, calc((100vw - 800px)/2), 170px); }
}
@media (max-width: 1000px) {
  .how-foliage-top { opacity: .75; }
}
@media (max-width: 760px) {
  body:is([data-page="how"], [data-page="subscription"]) { --reading-offset: 1.3em; }
  .step { padding: 31px 0 34px; }
  .step + .step { margin-top: 20px; }
  .step-copy, .reference, .closing { max-width: none; }
  .step-copy::before { inset: -20px -12px -20px -34px; border-radius: 12px; }
  .step .step-title { font-size: 26px; }
  .step p { font-size: 16px; line-height: 1.75; }
  .reference { padding: 43px 0; }
  .reference > h2 { font-size: 33px; margin-bottom: 26px; }
  .accordion summary { font-size: 18px; padding: 20px 0; }
  .detail-body { font-size: 16px; }
  .closing { flex-direction: column; gap: 26px; margin-bottom: 45px; }
  .how-foliage-top { width: 94px; opacity: .45; }
}
@media (max-width: 580px) {
  body:is([data-page="how"], [data-page="subscription"]) .button.pp-install { font-size: 27px; padding: 18px 23px; }
  .prompt.prompt-composer {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
    padding: 17px 15px 12px;
    border-radius: 27px;
  }
  .prompt.prompt-composer p { font-size: 15px; }
  .composer-controls { grid-column: 1 / -1; justify-self: end; gap: 18px; }
  .composer-voice { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .how-foliage-top { animation: none; }
  .accordion summary::before, .accordion summary::after { transition: none; }
}

/* Subscription uses the same surface, reading column and card as the first step. */
.subscription-main { padding-top: 43px; padding-bottom: 80px; }
.subscription-main > .eyebrow, .subscription-main > h1 { margin-left: var(--reading-offset); }
.subscription-main > .eyebrow { margin-top: 0; margin-bottom: 12px; color: var(--muted); }
.subscription-main > h1 { margin-bottom: 62px; }
.subscription-trial-note { display: block; margin-top: 16px; color: var(--peach); font: 500 clamp(20px, 2.4vw, 28px)/1.4 Manrope, Arial, sans-serif; letter-spacing: -.02em; }
.subscription-trial-note[hidden] { display: none; }
.subscription-card p { color: var(--muted); margin: 0 0 18px; }
.subscription-price { font: 700 54px/1.2 Manrope, Arial, sans-serif; margin-bottom: 22px; letter-spacing: -.04em; }
.subscription-price strong { font: inherit; color: inherit; letter-spacing: inherit; }
.subscription-price span { font: 400 24px/1.5 Manrope, Arial, sans-serif; color: var(--muted); letter-spacing: -.025em; }
.subscription-card > .button { display: flex; width: fit-content; margin: 24px auto 0; }
@media (max-width: 760px) {
  .subscription-main { padding-top: 31px; padding-bottom: 60px; }
  .subscription-main > h1 { margin-bottom: 48px; }
  .subscription-card p { font-size: 16px; line-height: 1.75; }
}

/* Step 2 uses the same installation-button treatment, before the alternative instruction. */
.step-copy > .button[data-start-lesson] {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 24px;
}

/* The two onboarding actions share one explicit size, independent of label length. */
body[data-page="how"] .steps .step .step-copy > .button.pp-install {
  width: 340px;
  max-width: 100%;
  height: 80px;
}
@media (max-width: 480px) {
  body[data-page="how"] .steps .step .step-copy > .button.pp-install {
    height: 112px;
  }
}

/* Phone actions align with the reading column. */
@media(max-width:760px){body:is([data-page="how"],[data-page="subscription"]) .button.pp-install{left:0}}
