/* Phone and tablet layouts. Desktop composition stays in styles.css. */
@media (max-width: 800px) {
  body { min-width: 0; }
  main, section, .header-inner, .author-copy, .subscribe-copy { min-width: 0; }
  .container { width: auto; margin-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); }
  .site-header { height: 76px; position: relative; z-index: 10; }
  .header-inner { width: auto; margin-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right)); gap: 16px; }
  .menu-toggle { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; flex-shrink: 0; border: 1px solid #ededed; border-radius: 6px; background: #fff; }
  .menu-toggle span { width: 18px; height: 2px; background: #111; transition: transform .2s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .site-header nav { display: none; position: absolute; inset: 100% 0 auto; width: 100%; padding: 16px max(20px, env(safe-area-inset-right)) 22px max(20px, env(safe-area-inset-left)); background: #fff; border-bottom: 1px solid #ededed; box-shadow: 0 12px 20px #10203009; max-height: calc(100svh - 76px); overflow-y: auto; gap: 0; align-items: stretch; font-size: 16px; }
  .site-header nav.is-open { display: flex; flex-direction: column; }
  .site-header nav > a, .site-header nav > a:nth-of-type(4) { display: flex; min-height: 48px; align-items: center; padding: 10px 4px; }
  .site-header nav .button { width: 100%; min-height: 50px; font-size: 16px; margin-top: 10px; align-self: stretch; }
  .author-card { display: block; min-height: 0; }
  .author-copy { width: 100%; padding: 30px 28px 0; }
  .author-copy > p { font-size: 16px; max-width: none; line-height: 1.7; }
  .author-photo { position: relative; width: 100%; height: auto; max-height: 460px; margin-top: 28px; object-position: center top; }
  .author-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .author-stats dt { font-size: 12px; line-height: 1.5; }
  .author-stats dd { font-size: 18px; }
  .author-stats dd, .author-stats dt, .author-stats div > span { overflow-wrap: anywhere; }
  .author-stats div > span { font-size: 12px; line-height: 1.5; }
  .follow-button { min-height: 44px; }
  .review-window { width: auto; overflow: visible; padding-bottom: 0; }
  .review-window::before { inset-inline: 0; }
  .review-track { display: flex; gap: 18px; overflow-x: auto; padding: 6px 2px 18px; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .review-card { flex: 0 0 calc(50% - 9px); scroll-snap-align: start; min-width: 0; }
  .review-card > p, .benefit p, .benefits-intro > p { font-size: 16px; line-height: 1.7; }
  .hero-description, .author-copy > p, .review-card > p, .benefit p,
  .benefits-intro > p, .chapter-card p, .subscribe-copy > p,
  .recommendation-card blockquote { color: #66717a; }
  .author-stats div > span, .reader-downloads, .section-note,
  .review-person span, .workbook-includes ul { color: #6d7880; }
  .benefit summary { min-height: 58px; font-size: 16px; line-height: 1.5; padding-block: 18px; }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter-card { min-width: 0; min-height: 245px; padding: 24px; }
  .chapter-card h3 { font-size: 16px; line-height: 1.5; }
  .chapter-card p { font-size: 16px; line-height: 1.6; }
  .chapter-read { position: static; opacity: 1; font-size: 14px; margin-top: 16px; }
  .subscribe-copy { max-width: none; }
  .subscribe-copy > p { font-size: 16px; }
  .subscribe-copy input, .order-fields input { font-size: 16px; min-height: 50px; }
  .subscribe-copy .button, .awards-action .button { min-height: 48px; font-size: 16px; }
  .final-actions .button { white-space: normal; min-height: 54px; text-align: center; }
  .site-footer { font-size: 14px; }
  .site-footer > p > a { display: inline-flex; align-items: center; min-height: 44px; }
  .demo-note { position: static; flex-basis: 100%; max-width: none; font-size: 12px; line-height: 1.6; }
  dialog { overscroll-behavior: contain; scroll-padding-block: 56px 24px; max-height: calc(100dvh - 32px); }
  .dialog-close { min-width: 44px; min-height: 44px; }
  .format-option { min-height: 78px; font-size: 15px; }
  .format-option small { white-space: normal; font-size: 13px; line-height: 1.5; }
  .purchase-dialog .dialog-return, .purchase-dialog #checkout-link { min-height: 48px; font-size: 16px; }
  .order-fields label { font-size: 14px; }
  .checkout-privacy, .checkout-notice, .order-form .form-message { font-size: 14px; line-height: 1.6; }
  .checkout-notice { color: #7c5a20; }
  .order-form > .button { min-height: 52px; font-size: 16px; white-space: normal; line-height: 1.5; }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 20px; scroll-behavior: auto; }
  .site-header { height: 70px; }
  .brand-logo { width: 180px; height: 60px; }
  .site-header nav { max-height: calc(100svh - 70px); }
  .hero-content { padding-top: 30px; }
  .hero h1 { font-size: clamp(30px, 8.4vw, 42px); line-height: 1.16; margin-top: 26px; padding-inline: 20px; text-wrap: balance; }
  .hero-description { font-size: 16px; line-height: 1.6; margin-top: 22px; padding-inline: 22px; }
  .book-specs { display: grid; grid-template-columns: .85fr 1.5fr .7fr; margin: 26px 20px 0; }
  .book-specs > div { min-width: 0; padding-inline: 8px; }
  .book-specs dt { font-size: 12px; line-height: 1.35; }
  .book-specs dd { font-size: 14px; line-height: 1.5; white-space: normal; }
  .hero-actions { margin: 28px 24px 0; gap: 6px; }
  .hero-actions .button { width: 100%; max-width: 370px; font-size: 18px; min-height: 54px; }
  .hero-actions .text-button { min-height: 48px; font-size: 16px; }
  .reader-proof { margin: 22px 20px 0; gap: 10px; flex-wrap: wrap; }
  .reader-faces { width: 100px; }
  .rating-line { font-size: 12px; gap: 7px; flex-wrap: wrap; }
  .reader-downloads { font-size: 11px; line-height: 1.4; }
  .reader-proof .rating-line .icon { display: none; }
  .hero-book.pe-book { width: min(320px, calc(100% - 48px)); margin-top: 30px; padding: 9px 18px 28px; }
  .featured { margin-top: 32px; }
  .featured h2 { font-size: 18px; line-height: 1.5; }
  .logo-strip { transform: none; }
  .author-copy { padding: 24px 22px 0; }
  .author-copy h2, .benefits-intro h2, .subscribe-copy h2 { font-size: 30px; }
  .author-badges { gap: 9px; }
  .author-badges .pill { font-size: 12px; }
  .author-photo { max-height: 390px; }
  .author-stats { gap: 10px; margin-top: 26px; }
  .review-card { flex-basis: 92%; padding: 26px; }
  .review-person strong { font-size: 16px; }
  .review-person span { font-size: 13px; line-height: 1.4; }
  .section-heading h2 { font-size: 28px; line-height: 1.25; padding-inline: 20px; }
  .awards-banner { width: calc(100% - 40px); min-height: 0; }
  .awards-copy { padding: 30px 24px; }
  .awards-copy h2 { font-size: 28px; line-height: 1.2; }
  .awards-copy > p { font-size: 16px; max-width: none; }
  .award-tags > span { font-size: 12px; line-height: 1.4; }
  .pe-awards-art { opacity: .12; }
  .recommendation-card { padding: 68px 22px 32px; }
  .recommendation-card blockquote { font-size: 16px; line-height: 1.75; }
  .recommendation-card figcaption { font-size: 13px; line-height: 1.5; }
  .subscribe-copy form { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .subscribe-copy input, .subscribe-copy .button { width: 100%; min-height: 50px; font-size: 16px; }
  .chapter-grid { gap: 14px; }
  .chapter-card { padding: 20px 16px; min-height: 0; }
  .chapter-card h3 { font-size: 15px; }
  .chapter-card p { font-size: 15px; }
  .final-cta { padding: 28px 24px; }
  .final-cta h2 { font-size: clamp(28px, 7.6vw, 38px); line-height: 1.2; text-wrap: balance; }
  .final-actions { width: 100%; }
  .final-actions .button { width: 100%; font-size: 16px; }
  .offer-tag { font-size: 12px; line-height: 1.5; }
  .site-footer { padding-block: 44px max(36px, env(safe-area-inset-bottom)); gap: 24px; }
  .footer-brand { flex-wrap: wrap; gap: 18px; }
  .footer-brand p { font-size: 13px; }
  dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 24px 20px max(24px, env(safe-area-inset-bottom)); }
  .dialog-close { top: -18px; margin: -18px -12px 0 0; }
  .purchase-layout { gap: 8px; }
  .purchase-layout > img { height: 145px; }
  .purchase-dialog h2 { font-size: 28px; }
  .format-picker { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .format-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; align-items: center; padding: 14px; }
  .format-option strong { grid-column: 2; grid-row: 1 / 3; font-size: 23px; margin: 0; }
  .format-option small { grid-column: 1; grid-row: 2; margin-top: 3px; }
  #checkout-link { width: 100%; }
  .order-heading { flex-wrap: wrap; align-items: center; }
  .order-heading h3 { font-size: 24px; max-width: none; }
  .cashfree-wordmark { font-size: 11px; }
  .cashfree-wordmark strong { display: inline; font-size: 15px; margin-left: 4px; }
  .order-fields { grid-template-columns: 1fr; gap: 18px; }
  .order-fields .full-width { grid-column: auto; }
  .order-fields input { font-size: 16px; padding: 13px; }
  .order-total { font-size: 14px; align-items: flex-start; }
  .order-total strong { font-size: 24px; }
  .chapter-dialog h2 { font-size: 28px; overflow-wrap: anywhere; }
  .chapter-dialog .button { width: 100%; min-height: 48px; font-size: 16px; white-space: normal; }
}

@media (max-width: 360px) {
  .brand-logo { width: 168px; height: 56px; }
  .book-specs { grid-template-columns: .85fr 1.4fr .7fr; margin-inline: 14px; }
  .book-specs dt { font-size: 11px; }
  .book-specs dd { font-size: 13px; }
  .reader-proof { flex-direction: column; }
  .reader-proof-copy { text-align: center; }
  .rating-line { justify-content: center; }
  .chapter-grid { grid-template-columns: 1fr; }
  .chapter-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; padding: 22px 18px; }
  .chapter-number { grid-row: 1 / 4; }
  .chapter-card h3 { margin: 0; }
  .chapter-card p, .chapter-read { grid-column: 2; }
}

@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
  .menu-toggle span { transition: none; }
}

.review-person .review-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: #76623c;
}
