/* Mobile reuses the original content; desktop keeps its own composition. */
.mobile-nav-label,.mobile-gallery-caption,.mobile-gallery-kind,.mobile-project,.mobile-hero-art,.mobile-game-project{display:none}
.mobile-reading{display:none}
.image-viewer{position:fixed;inset:0;width:100%;max-width:none;height:100%;height:100dvh;max-height:none;margin:0;border:0;padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:#f8f0e6;color:var(--ink);overflow:auto;overscroll-behavior:contain}
.image-viewer::backdrop{background:rgba(57,45,53,.8)}
.image-viewer-shell{max-width:900px;margin:auto;min-height:100%;display:flex;flex-direction:column;gap:20px}
.image-viewer-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex:none}
.image-viewer-heading h2{margin:0;font:500 16px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;letter-spacing:0;max-width:42ch}
.image-viewer-heading button{flex:none;min-width:60px;min-height:44px;padding:10px;border:1px solid #d7b8be;border-radius:8px;background:transparent;color:var(--accent);font-size:14px;touch-action:manipulation}
.image-viewer img{display:block;width:100%;height:calc(100dvh - 170px);min-height:180px;object-fit:contain;margin:auto}
.image-viewer-error{margin:0;color:var(--accent);font-size:16px;line-height:1.75}

@media(max-width:700px), (max-width:1000px) and (max-height:600px) and (pointer:coarse){
  html.reading-layout{
    --reading-paper:#f8f0e6;
    --reading-blue:#dce8ed;
    --reading-edge:#decbc2;
    --reading-gutter:20px;
    background:var(--reading-paper);
    scroll-padding-top:calc(var(--reading-header-height,60px) + 20px);
    scrollbar-color:#bb8b91 var(--reading-paper);
  }
  .reading-layout body{background:var(--reading-paper);font-size:16px;line-height:1.75;caret-color:var(--accent)}
  .reading-layout ::selection{background:#ead0d5;color:#392d35}
  .reading-layout [hidden]{display:none!important}
  .reading-layout .stage,.reading-layout #glow-cursor,.reading-layout #intro,.reading-layout .cutout-frame--intro,.reading-layout .notice{display:none!important}

  /* A small, steady navigation strip leaves room for the opening illustration. */
  .reading-layout .site-header{position:sticky;inset:auto;top:0;z-index:20;width:100%;padding:max(8px,env(safe-area-inset-top)) max(var(--reading-gutter),env(safe-area-inset-right)) 8px max(var(--reading-gutter),env(safe-area-inset-left));flex-wrap:wrap;gap:4px 8px;background:var(--reading-paper);border-bottom:1px solid #e7d8ce;font-size:12px;line-height:1.4}
  .reading-layout .site-header::before{display:none}
  .reading-layout .brand{gap:6px;min-height:44px;white-space:nowrap;letter-spacing:0}
  .reading-layout .brand-mark{font-size:18px}
  .reading-layout .section-nav.pill-nav{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));flex:1 0 100%;width:100%;gap:2px;padding:0;background:none;animation:none;color:var(--accent);border-radius:0;font-size:13px}
  .reading-layout .section-nav.pill-nav a{display:flex;align-items:center;justify-content:center;width:auto;min-width:44px;min-height:44px;height:auto;padding:0 6px;border-radius:0;background:none;color:var(--muted);overflow:visible;border-bottom:2px solid transparent}
  .reading-layout .section-nav.pill-nav a[href="#hello"]{order:1}
  .reading-layout .section-nav.pill-nav a[href="#create"]{order:2}
  .reading-layout .section-nav.pill-nav a[href="#ideas"]{order:3}
  .reading-layout .section-nav.pill-nav a[href="abilities.html"]{order:4}
  .reading-layout .section-nav.pill-nav a[href="experience.html"]{order:5}
  .reading-layout .section-nav.pill-nav a[href="collaboration.html"]{order:6}
  .reading-layout .section-nav.pill-nav a:hover,.reading-layout .section-nav.pill-nav a[aria-current="location"]{color:var(--accent);border-bottom-color:var(--accent)}
  .reading-layout .pill-circle,.reading-layout .pill-label-stack{display:none}
  .reading-layout .mobile-nav-label{display:block}

  .reading-layout .mobile-reading{display:block;position:relative;z-index:2;width:100%;max-width:560px;margin:0 auto;padding:0 max(var(--reading-gutter),env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(var(--reading-gutter),env(safe-area-inset-left));font-size:16px;line-height:1.75;overflow-wrap:break-word}
  .reading-layout .mobile-reading h1,.reading-layout .mobile-reading h2,.reading-layout .mobile-reading h3{font-family:"Songti SC","Noto Serif CJK SC","Source Han Serif SC","STSong","SimSun",Georgia,serif;letter-spacing:-.025em;text-wrap:balance}
  .reading-layout .mobile-reading h2{position:relative;isolation:isolate;width:fit-content;max-width:100%;margin:0 0 26px;padding:0 30px 14px 0;font-size:26px;line-height:1.4;font-weight:400;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 14.4 9.6 21 12 14.4 14.4 12 21 9.6 14.4 3 12 9.6 9.6Z' fill='none' stroke='%23844b60' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") right 6px/18px 18px no-repeat}
  .reading-layout .mobile-reading h2::before{content:"";position:absolute;z-index:-1;inset:-10px -10px 0 -10px;pointer-events:none;background:url("paper-background.png") center 60%/cover no-repeat;opacity:.16}
  .reading-layout .mobile-reading h2::after{content:"";position:absolute;bottom:2px;left:0;width:46px;height:2px;border-radius:50%;background:var(--accent);transform:rotate(-2deg)}
  .reading-layout .mobile-reading #hero,.reading-layout .mobile-reading #hello,.reading-layout .mobile-reading #ideas,.reading-layout .mobile-reading #create{scroll-margin-top:0}
  .reading-layout .mobile-reading .eyebrow,.reading-layout .mobile-reading .hero-footer,.reading-layout .mobile-reading .section-topline,.reading-layout .mobile-reading .section-index,.reading-layout .mobile-reading .next-section{display:none}
  .reading-layout .mobile-reading .story-section,.reading-layout .mobile-reading #create{position:relative;min-height:0;height:auto;border:0}
  .reading-layout .mobile-reading .story-section::before{display:none}
  .reading-layout .mobile-reading .section-content,.reading-layout .mobile-reading #create .section-content{position:static;display:block;min-height:0;padding:0}
  .reading-layout .mobile-reading .section-copy{max-width:none;width:100%;opacity:1!important}

  /* The complete character, including the chair feet, is the opening picture. */
  .reading-layout .mobile-reading .hero{position:relative;isolation:isolate;height:auto;min-height:0;overflow:visible;padding:32px 0 36px}
  .reading-layout .mobile-reading .hero::before{content:"";position:absolute;inset:0 calc(-1 * var(--reading-gutter));z-index:-1;pointer-events:none;background:url("paper-background.png") center bottom/cover no-repeat;opacity:.25}
  .reading-layout .mobile-reading .hero-copy{width:100%;margin:0;padding:0;text-align:center;pointer-events:auto}
  .reading-layout .mobile-reading .hero-copy h1{font-size:clamp(24px,6.8vw,30px);line-height:1.6;font-weight:400}
  .reading-layout .mobile-reading .hero-copy .about-name{position:relative;isolation:isolate;width:fit-content;margin:18px auto 0;padding:0 5px;color:var(--ink);font-size:16px;line-height:1.75;font-weight:600;letter-spacing:.02em}
  .reading-layout .mobile-reading .hero-copy .about-name::after{content:"";position:absolute;inset:auto 0 4px;height:7px;z-index:-1;background:var(--reading-blue);transform:rotate(-2deg)}
  .reading-layout .mobile-hero-art{position:relative;display:block;width:clamp(180px,65vw,260px);max-width:100%;height:auto;margin:24px auto 0}
  .reading-layout .mobile-hero-art img,.reading-layout .mobile-hero-art #complete-sofa{position:static;inset:auto;display:block;width:100%;max-width:100%;height:auto;object-fit:contain;transform:none;opacity:1;filter:none;mask:none;-webkit-mask:none}
  .reading-layout .mobile-hero-art::before,.reading-layout .mobile-hero-art::after{content:"";position:absolute;width:22px;height:22px;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 14.4 9.6 21 12 14.4 14.4 12 21 9.6 14.4 3 12 9.6 9.6Z' fill='none' stroke='%23844b60' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat}
  .reading-layout .mobile-hero-art::before{top:28%;left:-24px;transform:rotate(9deg);opacity:.6}
  .reading-layout .mobile-hero-art::after{right:-22px;bottom:19%;width:16px;height:16px;opacity:.45;transform:rotate(-8deg)}

  .reading-layout .mobile-reading #hello{padding:32px 0 40px}
  .reading-layout .mobile-reading #hello .about-body{max-width:none;margin-top:0;font-size:16px;line-height:1.75;color:var(--muted)}
  .reading-layout .mobile-reading #hello .about-body p{margin:0 0 18px}
  .reading-layout .mobile-reading #hello .about-body p:last-child{margin:0}
  .reading-layout .mobile-reading #hello .about-body strong{color:var(--accent);font-weight:600}

  /* The book cover marks the chapter; the original poster opens the project. */
  .reading-layout .mobile-reading #create{padding:24px 0 0}
  .reading-layout .mobile-reading #create>.section-content{display:none}
  .reading-layout .mobile-reading .mobile-project{display:block}
  .reading-layout .mobile-project-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:100px;margin:0 0 20px}
  .reading-layout .mobile-project-heading h2{margin:0;flex:0 1 auto}
  .reading-layout .mobile-book-mark{display:block;flex:none;width:64px;max-width:22%;height:auto;object-fit:contain}
  .reading-layout .mobile-book-mark img{display:block;width:100%;height:auto;object-fit:contain}
  .reading-layout .mobile-reading .reader-face.reader-project-image,.reading-layout .mobile-reading .reader-face.reader-project-copy{position:static;inset:auto;display:block;width:100%;height:auto;min-height:0;max-height:none;transform:none;backface-visibility:visible;overflow:visible;padding:0;border:0;border-radius:0;background:none;box-shadow:none;cursor:auto}
  .reading-layout .mobile-reading .reader-face::after{display:none}
  .reading-layout .mobile-reading .reader-face.reader-project-image{padding:6px;background:#fffaf5;box-shadow:0 6px 18px rgba(93,64,65,.08)}
  .reading-layout .mobile-reading .reader-project-image img{display:block;width:100%;height:auto;object-fit:contain;border-radius:0}
  .reading-layout .mobile-reading .reader-project-copy{margin-top:28px}
  .reading-layout .mobile-reading .reader-project-copy .project-kicker{display:none}
  .reading-layout .mobile-reading .reader-project-copy h3{font-size:26px;line-height:1.5;font-weight:400;margin:0 0 18px}
  .reading-layout .mobile-reading .reader-project-copy h3 em{font-style:normal;color:var(--accent)}
  .reading-layout .mobile-reading .reader-project-copy p,.reading-layout .mobile-reading .reader-project-copy ul{font-size:16px;line-height:1.75;margin:0 0 18px;overflow-wrap:break-word;color:var(--muted)}
  .reading-layout .mobile-reading .reader-project-copy ul{padding-left:1.2em}
  .reading-layout .mobile-reading .reader-project-copy li+li{margin-top:14px}
  .reading-layout .mobile-reading .reader-project-copy strong{color:var(--ink);font-weight:600}
  .reading-layout .mobile-reading .project-film-link{font-size:16px;line-height:1.6}
  .reading-layout .mobile-project-details{margin-top:24px;border-top:1px solid var(--reading-edge);border-bottom:1px solid var(--reading-edge)}
  .reading-layout .mobile-project-details>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:12px 0;color:var(--accent);font-size:15px;line-height:1.6;list-style:none;cursor:pointer;touch-action:manipulation}
  .reading-layout .mobile-project-details>summary::-webkit-details-marker{display:none}
  .reading-layout .mobile-project-details>summary::marker{content:""}
  .reading-layout .mobile-project-details>summary svg{flex:none;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform 180ms ease}
  .reading-layout .mobile-project-details[open]>summary svg{transform:rotate(180deg)}
  .reading-layout .mobile-project-details-body{padding:8px 0 6px}
  .reading-layout .mobile-project-details-body>:last-child{margin-bottom:18px}

  /* The game uses the same book pages, moved after the first original project. */
  .reading-layout .mobile-game-project{display:block;margin:52px 0 0;padding:8px 0 0}
  .reading-layout .mobile-reading .mobile-game-project .reader-face:is(.reader-game-copy,.reader-metrics-copy){position:static;inset:auto;display:block;width:100%;height:auto;min-height:0;max-height:none;transform:none;backface-visibility:visible;overflow:visible;padding:0;border:0;border-radius:0;background:none;box-shadow:none;cursor:auto;margin-top:28px}
  .reading-layout .mobile-game-project .project-kicker{display:none}
  .reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) h3{font-size:26px;line-height:1.5;font-weight:400;margin:0 0 18px}
  .reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) h3 em{font-style:normal;color:var(--accent)}
  .reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) p,.reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) ul{font-size:16px;line-height:1.75;margin:0 0 18px;overflow-wrap:break-word;color:var(--muted)}
  .reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) ul{padding-left:1.2em}
  .reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) li+li{margin-top:14px}
  .reading-layout .mobile-game-project :is(.reader-game-copy,.reader-metrics-copy) strong{color:var(--ink);font-weight:600}
  .reading-layout .mobile-game-project .project-demo-link{display:inline-flex;align-items:center;min-height:44px;max-width:100%;padding:7px 0;margin:0 0 10px;color:var(--accent);font-size:16px;line-height:1.6;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px;touch-action:manipulation}
  .reading-layout .mobile-game-project .project-demo-link:hover{text-decoration-thickness:2px}
  .reading-layout .mobile-game-details{scroll-margin-top:0}
  .reading-layout .mobile-wenyi-project .reader-face.reader-wenyi-copy{position:static;inset:auto;display:block;width:100%;height:auto;min-height:0;max-height:none;transform:none;backface-visibility:visible;overflow:visible;padding:0;border:0;border-radius:0;background:none;box-shadow:none;cursor:auto;margin-top:28px}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy h3{font-size:26px;line-height:1.5;font-weight:400;margin:0 0 18px}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy h3 em{font-style:normal;color:var(--accent)}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy p,.reading-layout .mobile-wenyi-project .reader-wenyi-copy ul{font-size:16px;line-height:1.75;margin:0 0 18px;overflow-wrap:break-word;color:var(--muted)}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy ul{padding-left:1.2em}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy li+li{margin-top:14px}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy strong{color:var(--ink);font-weight:600}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy blockquote{margin:0 0 18px;padding:12px 0;border-color:var(--reading-edge)}
  .reading-layout .mobile-wenyi-project .reader-wenyi-copy blockquote p{margin:0}

  /* Thin paper mounts shift slightly; every picture and its text stays level. */
  .reading-layout .mobile-gallery{margin-top:56px;padding-top:32px;border-top:1px solid var(--reading-edge)}
  .reading-layout .mobile-reading .hero-frames.flex-carousel{position:static;inset:auto;display:block;width:100%;height:auto;overflow:visible;pointer-events:auto;touch-action:pan-y}
  .reading-layout .mobile-reading .flex-carousel__fallback{position:static;inset:auto;display:grid!important;height:auto;min-height:0;overflow:visible;padding:0 0 12px;align-items:start;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:26px 14px;pointer-events:auto;opacity:1;visibility:visible}
  .reading-layout .mobile-reading .hero-frames.flex-carousel .hero-frame{position:relative;isolation:isolate;inset:auto;display:block;width:100%!important;height:auto;aspect-ratio:auto;margin:0;padding:0;border:0;border-radius:0;background:none;transform:none!important;overflow:visible;text-align:left;color:var(--muted);cursor:zoom-in;touch-action:manipulation}
  .reading-layout .mobile-reading .hero-frames.flex-carousel .hero-frame:nth-child(even){margin-top:12px}
  .reading-layout .mobile-reading .hero-frame .flex-media{position:relative;isolation:isolate;display:block;width:100%;height:auto;aspect-ratio:auto;padding:4px;border:1px solid var(--reading-edge);border-radius:0;background:#fffaf4;overflow:visible}
  .reading-layout .mobile-reading .hero-frame .flex-media::before{content:"";position:absolute;z-index:-1;inset:4px -3px -4px 3px;pointer-events:none;border:1px solid #e2cfc4;background:none;transform:rotate(1.4deg)}
  .reading-layout .mobile-reading .hero-frame:nth-child(even) .flex-media::before{transform:rotate(-1.4deg)}
  .reading-layout .mobile-reading .hero-frame img{display:block;width:100%;height:auto;object-fit:contain;transform:none;filter:none}
  .reading-layout .mobile-reading .mobile-gallery-kind{display:block;width:fit-content;margin:12px 0 5px;color:var(--accent);font-size:12px;line-height:1.5;font-weight:600;letter-spacing:.05em}
  .reading-layout .mobile-reading .mobile-gallery-caption{display:block;margin:0;font-size:13px;line-height:1.65;overflow-wrap:break-word}
  .reading-layout .mobile-reading .flex-carousel canvas,.reading-layout .mobile-reading .flex-carousel__caption,.reading-layout .mobile-reading .flex-carousel__live{display:none!important}

  /* The last page is an open note, without a second disclosure control. */
  .reading-layout .mobile-reading #ideas{margin-top:56px;padding:0}
  .reading-layout .mobile-reading #ideas h2{margin-bottom:26px}
  .reading-layout .mobile-reading #ideas .description,.reading-layout .mobile-reading #ideas .note{display:block;max-width:none;margin:0 0 20px;padding:0;font-size:16px;line-height:1.75;color:var(--muted);text-wrap:pretty}
  .reading-layout .mobile-reading #ideas .word-line{display:flex;margin:28px 0 0;gap:0;font-size:14px;line-height:1.75;color:var(--accent)}
  .reading-layout .mobile-reading #ideas .word-line span{position:relative}
  .reading-layout .mobile-reading #ideas .word-line span+span{margin-left:34px}
  .reading-layout .mobile-reading #ideas .word-line span+span::before{content:"";position:absolute;top:.8em;left:-25px;width:16px;height:1px;background:#a5b8c2}
  .reading-layout .mobile-footer{margin-top:44px;padding-top:18px;border-top:1px solid var(--reading-edge);display:flex;align-items:center;justify-content:space-between;font-size:13px;line-height:1.6;color:var(--muted)}
  .reading-layout .mobile-footer a{display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-decoration-color:#c8a2ad;text-underline-offset:5px;color:var(--accent)}

  .reading-layout .mobile-image-error{display:block;margin:0;padding:18px 12px;color:var(--accent);font-size:14px;line-height:1.75;text-align:left;background:#f4e5de;overflow-wrap:break-word}
  .reading-layout .mobile-reading .image-load-error>img{display:none!important}
  .reading-layout .mobile-hero-art.image-load-error{width:100%;max-width:280px;min-height:100px}
  .reading-layout .hero-frame .flex-media.image-load-error{min-height:180px;display:flex;align-items:center}
  .reading-layout .mobile-reading a:focus-visible,.reading-layout .mobile-reading button:focus-visible,.reading-layout .mobile-project-details>summary:focus-visible,.reading-layout .site-header a:focus-visible,.reading-layout .image-viewer button:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
  .reading-layout .image-viewer-heading button:hover{background:#f0dfe0}

  /* Already-visible defaults survive a missing observer or script failure. */
  .reading-layout .scrapbook-reveal{animation:mobile-scrapbook-reveal 300ms cubic-bezier(.16,1,.3,1) both}
  @keyframes mobile-scrapbook-reveal{from{opacity:.7;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
}

@media(max-width:340px){
  html.reading-layout{--reading-gutter:16px}
  .reading-layout .section-nav.pill-nav a{padding:0 4px}
  .reading-layout .mobile-reading .flex-carousel__fallback{gap:26px 12px}
}
@media(max-width:1000px) and (max-height:450px){
  .reading-layout .mobile-reading .hero{padding-top:24px;padding-bottom:28px}
  .reading-layout .mobile-hero-art{max-width:180px;margin-top:18px}
}
@media(prefers-reduced-motion:reduce){
  .reading-layout .scrapbook-reveal{animation:none;opacity:1;transform:none}
  .reading-layout .mobile-project-details>summary svg{transition:none}
}


@media(max-width:700px),(max-width:1000px) and (max-height:600px) and (pointer:coarse){
.reading-layout .mobile-metrics-project .reader-metrics-image>h3,.reading-layout .mobile-metrics-project .reader-metrics-image>p{display:none}
.reading-layout .mobile-metrics-project .reader-metrics-image img{width:100%;height:auto;max-height:none;background:#fff8f0}
}
