/* Content-led layouts: small/short screens scroll normally, never inside a
   clipped sticky panel. The travelling book still follows the real DOM dock. */
.light-controls input,#book-tilt,#polygon-sides{min-height:44px}
.hero nav button,.hero .outline,.wordmark{min-height:44px}
.wordmark{display:flex;flex-direction:column;justify-content:center}
.chapter-writing textarea{font-size:16px}
.read-book{display:block;min-height:48px;padding:12px 0;font-size:13px;text-decoration:underline;text-underline-offset:4px;color:inherit}
#book-reader{color-scheme:light;background:#f4eee2;color:#34362e;max-width:640px}
#book-reader h3{font:24px/1.2 Georgia,serif;margin-top:30px}#book-reader p{color:#4d5044;font-size:17px;line-height:1.75;overflow-wrap:anywhere}
#scene.travelling{height:var(--orbit-scene-height,100svh);bottom:auto}
.mobile-book-preview{display:none}
.mobile-book-return{display:none}
#mobile-journey-canvas{position:fixed;top:0;left:0;z-index:3;pointer-events:none}
@media(max-width:900px){
  #book-reader{padding:24px;overflow:hidden}
  #book-reader h2{margin:0 48px 20px 0}
  #book-reader>div{max-height:calc(85svh - 125px);overflow-y:auto;overscroll-behavior:contain}
  html{scroll-padding-top:16px}
  .mobile-book-return{display:flex;align-items:center;min-height:48px;font-size:13px;text-decoration:underline;text-underline-offset:4px}
  #learning-journey{position:relative}
  .mobile-preview-label{display:flex;justify-content:space-between;font-size:10px;line-height:18px;letter-spacing:.08em;color:#6d675a;margin:0;width:min(100%,430px);align-self:center}
  .mobile-preview-label span{color:#8e8779;font-size:9px}
  #mobile-book-stage{width:min(100%,430px);flex:1;min-height:0;align-self:center}
  .chapter{height:auto;min-height:0}
  .chapter .chapter-sticky{position:relative;top:auto;height:auto;min-height:0;overflow:visible;display:flex;flex-direction:column;padding:46px max(24px,6vw) 28px;gap:24px}
  /* Override the older, more-specific short-phone sticky offsets as well. */
  .chapter.light-lab .chapter-sticky,.chapter.design-studio .chapter-sticky,.chapter.pattern-room .chapter-sticky{top:auto;min-height:0}
  .chapter .chapter-sticky .chapter-heading,.chapter .chapter-sticky .chapter-copy,.chapter .chapter-sticky .book-dock,.chapter .chapter-sticky .next-chapter-link{position:relative;inset:auto;width:100%;margin:0}
  .chapter .chapter-heading{pointer-events:auto}
  .chapter .chapter-heading h2{font-size:clamp(32px,5vw,46px);line-height:1.08}
  .chapter .chapter-heading .eyebrow{font-size:10px;margin-bottom:12px}
  .chapter .chapter-sticky .book-dock{display:block;flex:none;height:clamp(240px,42vw,350px);max-width:500px;align-self:center}
  .chapter .book-dock{order:0}
  .chapter .chapter-heading{order:1}
  .chapter .chapter-copy{order:2}
  .chapter .next-chapter-link{order:3}
  .chapter .chapter-sticky:after{display:none}
  .chapter .chapter-heading,.chapter .chapter-copy,.chapter .next-chapter-link{z-index:1}
  .chapter .book-shadow{bottom:0;height:24px}
  .chapter .chapter-copy{max-width:620px;align-self:center}
  .chapter .chapter-sticky .chapter-copy,.chapter .chapter-sticky .chapter-heading,.chapter .chapter-sticky .next-chapter-link{width:100%;align-self:flex-start}
  .chapter .chapter-copy h3{font-size:28px;line-height:1.2;max-width:none}
  .chapter .chapter-kicker{font-size:10px;margin-bottom:16px}
  .chapter #chapter-description,.chapter .section-description{font-size:15px;line-height:1.7;max-width:none;margin-bottom:14px}
  .chapter .chapter-tabs{gap:18px;justify-content:space-between;margin-bottom:22px}
  .chapter .chapter-tabs button{font-size:13px;min-height:44px;padding:10px 0}
  .chapter .chapter-excerpt p{font-size:18px;line-height:1.55;max-width:none}
  .chapter .chapter-excerpt span,.chapter-writing label{font-size:10px}
  .chapter-writing p{font-size:12px;line-height:1.5}
  .chapter .chapter-next{font-size:14px;min-height:48px;margin-top:20px}
  .chapter .chapter-continue{font-size:12px;min-height:48px;display:flex;align-items:center;margin:12px 0 0;line-height:1.5}
  .chapter .next-chapter-link{min-height:48px;font-size:12px;line-height:1.5;gap:18px;padding:16px 0 0;opacity:.85;max-width:620px;align-self:center}
  .light-controls{max-width:none}.light-controls label{font-size:14px;margin-top:12px}.light-controls output{font-size:13px}
  .chapter .light-result{font-size:18px;margin:16px 0}
  .experiment-presets button,.palette-picker button,.layout-picker button,.symmetry-button{font-size:13px;min-height:48px;padding:12px 15px}
  .palette-picker,.layout-picker{gap:8px;margin-top:20px}.palette-picker legend,.layout-picker legend,.tilt-label{font-size:13px}
  .chapter .tilt-label{margin-top:22px}.chapter .design-feedback,.chapter .pattern-explanation{font-size:15px;line-height:1.6;max-width:none}
  .chapter .pattern-facts{padding-top:18px;gap:44px}.pattern-facts span{font-size:10px}
  .chapter-index{grid-template-columns:1fr 1fr}
}
@media(min-width:901px) and (max-height:800px){
  .chapter .chapter-sticky{height:760px;min-height:760px;top:min(0px,calc(100svh - 760px))}
  .chapter .chapter-heading{top:5%}
  .chapter .chapter-heading h2{font-size:42px}
  .chapter .chapter-copy{top:22%}
  .chapter.light-lab .chapter-copy,.chapter.pattern-room .chapter-copy{top:25%}
  .chapter .chapter-copy h3{font-size:28px}
  .chapter .book-dock{top:37%;height:46%}
  .chapter.light-lab .book-dock,.chapter.pattern-room .book-dock{top:32%;height:48%}
}
@media(max-width:600px){
  .hero header{padding:16px;gap:10px}.hero .outline{font-size:12px;padding:10px 12px}.hero nav button{padding:10px 7px;font-size:12px}
  .hero .heading{top:15%;padding:0 14px}.hero h1{font-size:clamp(29px,8.2vw,38px);line-height:1.08}.hero .heading .eyebrow{font-size:8px;margin-bottom:12px}
  .chapter .chapter-sticky{padding:36px 24px 24px;gap:22px}.chapter .chapter-sticky .book-dock{height:clamp(210px,62vw,310px)}
  .chapter .chapter-heading h2{font-size:34px}.chapter .chapter-copy h3{font-size:26px}
  .chapter-index{grid-template-columns:1fr}.chapter-index a{min-height:60px}
  dialog{padding:52px 24px 24px;max-height:90svh}.subject-options{grid-template-columns:1fr}
}
@media(max-width:360px){.hero nav{display:none}.hero .wordmark{font-size:20px}.chapter .chapter-sticky{padding-left:20px;padding-right:20px}.chapter .chapter-heading h2{font-size:31px}.chapter .chapter-tabs{gap:10px}.chapter .chapter-tabs button{font-size:12px}}
@media(max-height:500px) and (min-width:601px){.hero .heading{top:20%}.hero h1{font-size:40px}.chapter .book-dock{height:270px}.hero header{padding:18px 24px}}
