/* Full-size project scenes. All selectors stay inside the detailed chapters. */
.chapter .chapter-stage {
  height: auto;
  min-height: 0;
  max-height: none;
}
.chapter .chapter-inner {
  width: 100%;
  max-width: 1664px;
  min-height: 0;
  padding: 88px 64px 62px;
  grid-template-columns: clamp(276px, 21.875vw, 336px) minmax(0, 1fr);
  gap: 24px;
}
.chapter.chapter-reverse .chapter-inner {
  grid-template-columns: minmax(0, 1fr) clamp(276px, 21.875vw, 336px);
}
.chapter .chapter-copy {
  width: 100%;
  max-width: 336px;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.chapter.chapter-reverse .chapter-copy { grid-column: 2; justify-self: end; }
.chapter .product-showcase {
  width: 100%;
  max-width: none;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}
.chapter.chapter-reverse .product-showcase { grid-column: 1; }
.chapter .product-art { width: 100%; }
.chapter .chapter-label { font-size: 19px; gap: 13px; margin-bottom: 24px; }
.chapter .chapter-label .app-icon { width: 40px; height: 40px; border-radius: 12px; }
.chapter .project-title { font-size: clamp(42px, 3.65vw, 60px); line-height: 1.24; letter-spacing: -.055em; }
.chapter .project-title > span { white-space: normal; overflow-wrap: anywhere; }
.chapter .chapter-description { max-width: 336px; font-size: 17px; line-height: 1.85; margin: 24px 0 28px; }
.chapter .feature-tags { font-size: 13px; flex-wrap: wrap; row-gap: 8px; }
.chapter .chapter-index { left: 64px; right: 64px; bottom: 23px; }
.chapter .preview-caption { margin-top: 21px; font-size: 12px; letter-spacing: .12em; }
.chapter .browser-frame { border-radius: 19px; transform: none; }
.chapter .window-bar { height: 44px; padding: 0 20px; }
.chapter .traffic { width: 56px; gap: 7px; }
.chapter .traffic i { width: 10px; height: 10px; }
.chapter .window-title { font-size: 13px; }
.chapter .window-more { font-size: 20px; }
.chapter .preview-brand { font-size: 32px; }
.chapter .preview-brand > span { font-size: 13px; }
.chapter .preview-small { font-size: 13px; line-height: 1.5; }

/* Atlas: the browser itself fills the wider column, without scaling a small UI. */
.chapter .atlas-layout { grid-template-columns: 1.04fr 1fr; min-height: 570px; }
.chapter .atlas-overview { padding: 28px; }
.chapter .atlas-overview > .preview-small { margin-top: 20px; }
.chapter .atlas-overview h3 { font-size: 34px; line-height: 1.2; margin: 7px 0 14px; }
.chapter .preview-tabs { font-size: 15px; gap: 24px; margin: 12px 0 15px; }
.chapter .travel-photo { height: 200px; border-radius: 12px; }
.chapter .travel-photo > span { left: 17px; bottom: 17px; font-size: 19px; }
.chapter .travel-photo small { font-size: 12px; margin-top: 5px; }
.chapter .discovery-row { gap: 14px; margin-top: 20px; }
.chapter .discovery-row > img { width: 62px; height: 58px; border-radius: 10px; }
.chapter .discovery-row b { font-size: 14px; white-space: normal; }
.chapter .discovery-row div > span { font-size: 12px; margin-top: 7px; }
.chapter .discovery-row > svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.chapter .map-bubble { padding: 10px 17px 10px 9px; gap: 9px; font-size: 14px; }
.chapter .map-bubble > span { width: 30px; height: 30px; font-size: 12px; }
.chapter .map-caption { font-size: 13px; bottom: 22px; }

/* Lian: a physically larger handset with readable labels and room for its note. */
.chapter .lian-composition { min-height: 620px; }
.chapter .phone-frame { width: 340px; padding: 9px; border-radius: 49px; transform: rotate(-5deg); }
.chapter .phone-content { padding: 54px 25px 15px; border-radius: 40px; }
.chapter .phone-camera { width: 88px; height: 23px; top: 19px; left: calc(50% - 44px); }
.chapter .phone-top > b { font-size: 28px; }
.chapter .phone-top > span { font-size: 11px; }
.chapter .phone-content > .preview-small { font-size: 11px; margin-top: 20px; }
.chapter .phone-content > h3 { font-size: 25px; margin-top: 5px; }
.chapter .activity-ring { height: 226px; margin: 12px 0; }
.chapter .activity-ring > div { gap: 8px; }
.chapter .activity-ring > div > span { font-size: 11px; }
.chapter .activity-ring b { font-size: 25px; }
.chapter .activity-ring small { font-size: 12px; }
.chapter .workout-tile { padding: 17px 15px; border-radius: 15px; }
.chapter .workout-tile span { font-size: 11px; }
.chapter .workout-tile strong { font-size: 14px; margin-top: 7px; }
.chapter .workout-tile .lime-arrow { width: 31px; height: 31px; }
.chapter .lime-arrow svg { width: 19px; height: 19px; }
.chapter .mini-week { margin: 21px 0; }
.chapter .mini-week > span { width: 28px; height: 32px; font-size: 11px; }
.chapter .phone-nav { font-size: 12px; padding: 14px 0 11px; }
.chapter .lian-note { right: 9%; bottom: 74px; padding: 22px 25px; gap: 15px; border-radius: 19px; }
.chapter .note-icon .app-icon { width: 48px; height: 48px; border-radius: 14px; }
.chapter .lian-note b { font-size: 18px; }
.chapter .lian-note p { font-size: 13px; margin-top: 5px; }

/* MA: the paper and typography grow together, preserving the original composition. */
.chapter .ma-composition { height: 620px; }
.chapter .ma-paper { width: 430px; min-height: 550px; padding: 35px 42px; border-radius: 12px; transform: rotate(4deg); }
.chapter .ma-top { font-size: 12px; }
.chapter .ma-seal { width: 48px; height: 51px; font-size: 32px; }
.chapter .ma-kicker { font-size: 10px; margin-top: 40px; }
.chapter .ma-word { font-size: 96px; margin: 38px 0 15px; }
.chapter .ma-word rt { font-size: 17px; }
.chapter .ma-translation { font-size: 15px; }
.chapter .ma-rule { margin: 30px 0 26px; }
.chapter .ma-example p { font-size: 26px; }
.chapter .ma-example > span { font-size: 13px; margin-top: 10px; }
.chapter .ma-bottom { font-size: 12px; margin-top: 29px; }
.chapter .ma-float { width: 154px; height: 176px; left: 12%; bottom: 9px; font-size: 77px; border-radius: 13px; }
.chapter .ma-float > span { font-size: 12px; }

/* Codex Monitor and AI Follow retain full-width panels at desktop sizes. */
.chapter .monitor-layout { min-height: 536px; }
.chapter .monitor-sidebar { min-width: 88px; padding: 28px 14px; gap: 36px; font-size: 13px; }
.chapter .monitor-mark { font-size: 34px; margin-bottom: 13px; }
.chapter .monitor-main { padding: 38px 30px 30px; }
.chapter .monitor-main .preview-brand { font-size: 26px; }
.chapter .monitor-main .preview-brand > span { font-size: 12px; }
.chapter .monitor-main > .preview-small { font-size: 13px; margin-top: 12px; }
.chapter .monitor-panels { grid-template-columns: 1.25fr 1fr; gap: 19px; margin-top: 33px; }
.chapter .session-card, .chapter .usage-card { padding: 20px; border-radius: 14px; }
.chapter .session-label { font-size: 10px; }
.chapter .session-card h3 { font-size: 22px; margin: 18px 0 24px; }
.chapter .code-row { padding: 21px 0; gap: 10px; }
.chapter .code-dot { width: 7px; height: 7px; }
.chapter .code-row > b { font-size: 14px; }
.chapter .code-row > span:last-child { font-size: 10px; }
.chapter .usage-card { display: flex; }
.chapter .signal-bars { height: 180px; gap: 6px; }
.chapter .signal-bars i { height: calc(var(--bar) * 1.5); }
.chapter .usage-card > span:last-child { font-size: 11px; white-space: normal; }
.chapter .monitor-summary { font-size: 13px; margin-top: 30px; padding-top: 21px; }
.chapter .ai-composition { padding: 18px 0; }
.chapter .ai-frame { max-width: none; }
.chapter .ai-inner { padding: 36px 44px 38px; }
.chapter .ai-title { font-size: 32px; }
.chapter .ai-follow { font-size: 14px; margin-left: 15px; }
.chapter .radar-label { font-size: 12px; padding: 8px 13px; }
.chapter .ai-inner h3 { font-size: 16px; margin: 16px 0 32px; }
.chapter .ai-timeline { padding-left: 31px; }
.chapter .ai-timeline::before { left: 5px; bottom: 37px; }
.chapter .ai-timeline > div { padding: 0 0 32px 7px; }
.chapter .timeline-dot { width: 10px; height: 10px; top: 6px; left: -30px; }
.chapter .ai-timeline small { font-size: 11px; margin-bottom: 9px; }
.chapter .ai-timeline b { font-size: 20px; }
.chapter .ai-timeline p { font-size: 14px; margin-top: 8px; }

@media (min-width: 1000px) and (min-height: 850px) {
  .chapter .chapter-inner { min-height: 100svh; }
  html[data-motion="full"] .chapter .chapter-stage { height: 100svh; min-height: 0; max-height: none; }
}

/* A short desktop viewport uses document flow instead of cropping the larger art. */
@media (max-height: 849px) {
  html[data-motion="full"] .chapter { height: auto; }
  html[data-motion="full"] .chapter .chapter-stage { position: relative; top: auto; height: auto; min-height: 0; max-height: none; }
  .chapter .chapter-inner { min-height: 0; }
}

@media (min-width: 1000px) and (max-width: 1279px) {
  .chapter .chapter-inner { padding-left: 40px; padding-right: 40px; gap: 22px; }
  .chapter .chapter-index { left: 40px; right: 40px; }
  .chapter .project-title { font-size: 43px; }
  .chapter .chapter-description { font-size: 16px; }
  .chapter .atlas-overview { padding: 25px 22px; }
  .chapter .atlas-overview h3 { font-size: 27px; }
  .chapter .preview-brand { font-size: 27px; }
  .chapter .travel-photo > span { font-size: 15px; }
  .chapter .discovery-row { gap: 9px; }
  .chapter .discovery-row > img { width: 47px; height: 47px; }
  .chapter .discovery-row b { font-size: 12px; }
  .chapter .discovery-row div > span { font-size: 10px; }
  .chapter .discovery-row > svg { display: none; }
  .chapter .map-bubble { font-size: 11px; padding: 8px 11px 8px 7px; gap: 6px; }
  .chapter .map-bubble > span { width: 25px; height: 25px; font-size: 10px; }
  .chapter .lian-note { right: 0; padding: 18px; }
  .chapter .ma-float { left: 0; }
  .chapter .monitor-sidebar { min-width: 65px; padding: 26px 10px; font-size: 11px; }
  .chapter .monitor-main { padding: 32px 20px 26px; }
  .chapter .monitor-main .preview-brand { font-size: 20px; }
  .chapter .monitor-main .preview-brand > span { font-size: 10px; }
  .chapter .monitor-panels { grid-template-columns: 1fr; }
  .chapter .usage-card { display: none; }
  .chapter .ai-inner { padding: 32px; }
  .chapter .ai-timeline b { font-size: 18px; }
}

@media (max-width: 999px) {
  .chapter .chapter-inner, .chapter.chapter-reverse .chapter-inner {
    max-width: 900px;
    grid-template-columns: minmax(0, 1fr);
    padding: 80px 36px 78px;
    gap: 43px;
  }
  .chapter .chapter-copy, .chapter.chapter-reverse .chapter-copy { max-width: 580px; grid-column: 1; grid-row: 1; justify-self: center; text-align: center; }
  .chapter .product-showcase, .chapter.chapter-reverse .product-showcase { grid-column: 1; grid-row: 2; max-width: 800px; }
  .chapter .chapter-label { justify-content: center; }
  .chapter .project-title { font-size: 48px; }
  .chapter .chapter-description { max-width: 520px; margin: 23px auto 27px; }
  .chapter .feature-tags { justify-content: center; }
  .chapter .chapter-index { left: 36px; right: 36px; }
  .chapter .atlas-overview h3 { font-size: 29px; }
  .chapter .atlas-overview { padding: 27px 24px; }
  .chapter .travel-photo > span { font-size: 16px; }
  .chapter .discovery-row b { font-size: 12px; }
  .chapter .discovery-row div > span { font-size: 10px; }
  .chapter .map-bubble { font-size: 12px; }
  .chapter .monitor-main { padding: 30px 25px; }
  .chapter .monitor-main .preview-brand { font-size: 23px; }
  .chapter .monitor-panels { gap: 14px; }
  .chapter .session-card, .chapter .usage-card { padding: 16px; }
  .chapter .code-row > b { font-size: 12px; }
  .chapter .code-row > span:last-child { font-size: 8px; }
}

@media (max-width: 600px) {
  .chapter .chapter-inner, .chapter.chapter-reverse .chapter-inner { padding: 68px 20px 66px; gap: 34px; }
  .chapter .chapter-copy { max-width: 100%; }
  .chapter .chapter-label { font-size: 15px; gap: 10px; margin-bottom: 18px; }
  .chapter .chapter-label .app-icon { width: 31px; height: 31px; border-radius: 9px; }
  .chapter .project-title { font-size: clamp(34px, 9.6vw, 42px); }
  .chapter .project-title > span { display: block; }
  .chapter .chapter-description { max-width: 350px; font-size: 15px; margin: 20px auto 23px; }
  .chapter .feature-tags { font-size: 12px; }
  .chapter .chapter-index { left: 20px; right: 20px; bottom: 21px; }
  .chapter .preview-caption { font-size: 10px; margin-top: 19px; }
  .chapter .browser-frame { border-radius: 13px; }
  .chapter .window-bar { height: 31px; padding: 0 12px; }
  .chapter .traffic { width: 37px; gap: 5px; }
  .chapter .traffic i { width: 6px; height: 6px; }
  .chapter .window-title { font-size: 9px; }
  .chapter .window-more { font-size: 15px; }
  .chapter .preview-brand { font-size: 22px; }
  .chapter .preview-brand > span { font-size: 9px; }
  .chapter .preview-small { font-size: 9px; }
  .chapter .atlas-layout { grid-template-columns: 1.14fr 1fr; min-height: 366px; }
  .chapter .atlas-overview { padding: 21px 13px; }
  .chapter .atlas-overview > .preview-small { margin-top: 18px; }
  .chapter .atlas-overview h3 { font-size: 19px; margin: 7px 0 12px; }
  .chapter .preview-tabs { font-size: 10px; gap: 17px; margin: 10px 0 12px; }
  .chapter .travel-photo { height: 147px; border-radius: 8px; }
  .chapter .travel-photo > span { left: 9px; bottom: 11px; font-size: 10px; white-space: normal; }
  .chapter .travel-photo small { font-size: 8px; margin-top: 4px; }
  .chapter .discovery-row { gap: 7px; margin-top: 16px; }
  .chapter .discovery-row > img { width: 35px; height: 38px; border-radius: 6px; }
  .chapter .discovery-row b { font-size: 9px; }
  .chapter .discovery-row div > span { font-size: 7px; margin-top: 5px; }
  .chapter .discovery-row > svg { display: none; }
  .chapter .map-bubble { font-size: 8px; padding: 7px 8px 7px 5px; gap: 5px; }
  .chapter .map-bubble > span { width: 19px; height: 19px; font-size: 7px; }
  .chapter .map-caption { font-size: 8px; bottom: 19px; }
  .chapter .lian-composition { min-height: 564px; }
  .chapter .phone-frame { width: 280px; padding: 8px; border-radius: 43px; transform: rotate(-3deg); }
  .chapter .phone-content { padding: 48px 20px 12px; border-radius: 35px; }
  .chapter .phone-camera { width: 78px; height: 21px; left: calc(50% - 39px); top: 18px; }
  .chapter .phone-top > b { font-size: 24px; }
  .chapter .phone-top > span { font-size: 10px; }
  .chapter .phone-content > .preview-small { font-size: 9px; margin-top: 19px; }
  .chapter .phone-content > h3 { font-size: 22px; }
  .chapter .activity-ring { height: 192px; margin: 11px 0; }
  .chapter .activity-ring > div > span { font-size: 10px; }
  .chapter .activity-ring b { font-size: 22px; }
  .chapter .activity-ring small { font-size: 10px; }
  .chapter .workout-tile { padding: 15px 12px; }
  .chapter .workout-tile span { font-size: 10px; }
  .chapter .workout-tile strong { font-size: 12px; }
  .chapter .workout-tile .lime-arrow { width: 28px; height: 28px; }
  .chapter .mini-week { margin: 19px 0; }
  .chapter .mini-week > span { width: 24px; height: 29px; font-size: 10px; }
  .chapter .phone-nav { font-size: 10px; padding: 13px 0 10px; }
  .chapter .lian-note { right: 0; bottom: 36px; padding: 16px; gap: 11px; border-radius: 15px; }
  .chapter .note-icon .app-icon { width: 36px; height: 36px; border-radius: 11px; }
  .chapter .lian-note b { font-size: 14px; }
  .chapter .lian-note p { font-size: 10px; margin-top: 4px; }
  .chapter .ma-composition { height: 480px; margin-top: 0; }
  .chapter .ma-paper { width: 294px; min-height: 420px; padding: 26px; transform: rotate(3deg); }
  .chapter .ma-top { font-size: 8px; }
  .chapter .ma-seal { width: 36px; height: 39px; font-size: 25px; }
  .chapter .ma-kicker { font-size: 8px; margin-top: 30px; }
  .chapter .ma-word { font-size: 75px; margin: 29px 0 12px; }
  .chapter .ma-word rt { font-size: 13px; }
  .chapter .ma-translation { font-size: 11px; }
  .chapter .ma-rule { margin: 23px 0 21px; }
  .chapter .ma-example p { font-size: 20px; }
  .chapter .ma-example > span { font-size: 10px; margin-top: 8px; }
  .chapter .ma-bottom { font-size: 9px; margin-top: 25px; }
  .chapter .ma-float { width: 108px; height: 126px; left: 0; bottom: 0; font-size: 55px; border-radius: 10px; }
  .chapter .ma-float > span { font-size: 9px; }
  .chapter .monitor-layout { min-height: 361px; }
  .chapter .monitor-sidebar { min-width: 48px; padding: 23px 8px; gap: 30px; font-size: 9px; }
  .chapter .monitor-mark { font-size: 23px; margin-bottom: 9px; }
  .chapter .monitor-main { padding: 25px 15px 22px; }
  .chapter .monitor-main .preview-brand { font-size: 15px; gap: 7px; }
  .chapter .monitor-main .preview-brand > span { font-size: 7px; }
  .chapter .monitor-main > .preview-small { font-size: 9px; margin-top: 9px; }
  .chapter .monitor-panels { grid-template-columns: 1fr; margin-top: 24px; }
  .chapter .session-card { padding: 14px; }
  .chapter .session-label { font-size: 8px; }
  .chapter .session-card h3 { font-size: 16px; margin: 15px 0 19px; }
  .chapter .code-row { padding: 17px 0; gap: 8px; }
  .chapter .code-dot { width: 6px; height: 6px; }
  .chapter .code-row > b { font-size: 11px; }
  .chapter .code-row > span:last-child { font-size: 8px; }
  .chapter .usage-card { display: none; }
  .chapter .monitor-summary { font-size: 9px; margin-top: 23px; padding-top: 17px; }
  .chapter .ai-composition { padding: 8px 0; }
  .chapter .ai-inner { padding: 27px 24px; }
  .chapter .ai-title { font-size: 25px; }
  .chapter .ai-follow { font-size: 10px; margin-left: 9px; }
  .chapter .radar-label { font-size: 9px; padding: 6px 9px; }
  .chapter .ai-inner h3 { font-size: 12px; margin: 14px 0 28px; }
  .chapter .ai-timeline { padding-left: 24px; }
  .chapter .ai-timeline::before { left: 4px; bottom: 30px; }
  .chapter .ai-timeline > div { padding: 0 0 27px 5px; }
  .chapter .timeline-dot { width: 8px; height: 8px; left: -23px; }
  .chapter .ai-timeline small { font-size: 8px; margin-bottom: 8px; }
  .chapter .ai-timeline b { font-size: 14px; }
  .chapter .ai-timeline p { font-size: 11px; margin-top: 7px; }
}

@media (max-width: 360px) {
  .chapter .chapter-inner, .chapter.chapter-reverse .chapter-inner { padding-left: 16px; padding-right: 16px; }
  .chapter .atlas-overview { padding-left: 10px; padding-right: 10px; }
  .chapter .atlas-overview h3 { font-size: 17px; }
  .chapter .preview-brand { font-size: 20px; }
  .chapter .map-bubble { font-size: 7px; gap: 4px; padding-right: 6px; }
  .chapter .map-bubble > span { width: 17px; height: 17px; }
  .chapter .phone-frame { width: 258px; transform: rotate(-2deg); }
  .chapter .phone-content { padding-left: 17px; padding-right: 17px; }
  .chapter .workout-tile strong { font-size: 11px; }
  .chapter .ma-paper { width: 265px; padding-left: 23px; padding-right: 23px; transform: rotate(2deg); }
  .chapter .ma-float { width: 98px; height: 118px; font-size: 51px; }
  .chapter .monitor-main { padding-left: 12px; padding-right: 12px; }
  .chapter .monitor-main .preview-brand { font-size: 13px; }
  .chapter .monitor-main .preview-brand > span { display: none; }
  .chapter .code-row { gap: 6px; }
  .chapter .code-row > b { font-size: 10px; }
  .chapter .code-row > span:last-child { font-size: 7px; }
  .chapter .ai-inner { padding-left: 20px; padding-right: 20px; }
  .chapter .ai-title { font-size: 23px; }
  .chapter .ai-follow { font-size: 9px; }
  .chapter .radar-label { font-size: 8px; padding: 5px 7px; }
  .chapter .ai-timeline b { font-size: 13px; }
  .chapter .ai-timeline p { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter .chapter-inner { min-height: 0; }
  .chapter .phone-frame, .chapter .ma-paper, .chapter .ma-float, .chapter .lian-note { transform: none; }
}

/* Continuous alternating sections: no pinned screens or reserved scroll gaps. */
html[data-motion] .chapter { height: auto; }
html[data-motion] .chapter .chapter-stage { position: relative; top: auto; height: auto; min-height: 0; max-height: none; }
.chapter .chapter-inner { min-height: 0; }
@media (min-width: 1280px) {
  #atlas .project-title, #lian .project-title { font-size: clamp(58px,4.3vw,68px); }
  .chapter .chapter-description { font-size: 18px; }
  .chapter .chapter-label { font-size: 21px; }
  .chapter .chapter-label .app-icon { width: 44px; height: 44px; }
  .chapter .atlas-overview h3 { font-size: 40px; }
  .chapter .travel-photo { height: 240px; }
  .chapter .atlas-layout { min-height: 600px; }
}
