/* Touch controls and narrow viewport layout. Desktop presentation stays in the existing stylesheets. */
.project-gallery-controls,.project-image-zoom{display:none;}
@media(max-width:680px){
  html{scroll-padding-top:76px;}
  body{min-width:0;}
  .wrap{width:100%;max-width:100%;padding-inline:16px;}
  #portfolio-content{min-width:0;overflow-x:clip;}
  .header{z-index:30;}
  .nav{height:66px;gap:10px;position:relative;}
  .brand{flex:none;font-size:27px;}
  .menu{display:inline-flex;align-items:center;justify-content:center;flex:0 0 48px;width:48px;height:48px;min-width:48px;min-height:48px;padding:0;touch-action:manipulation;}
  .contact{min-height:46px;padding:8px 13px;flex:none;}
  .navlinks{top:66px;left:0;right:0;max-height:calc(100dvh - 76px);overflow-y:auto;overscroll-behavior:contain;padding:12px 16px;background:#faf6ed;border-bottom:2px solid #91adc1;box-shadow:0 8px 18px #34465e2b;gap:6px;z-index:32;}
  .navlinks.open{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  .navlinks a{display:flex;align-items:center;min-height:48px;padding:10px 12px;white-space:normal;overflow-wrap:anywhere;}
  .desk-heading{gap:10px;align-items:center;}
  .desk-heading>div:not(.desk-doodle){min-width:0;}
  .desk-heading p{line-height:1.4;}
  .return-welcome{min-height:44px;flex:none;white-space:nowrap;}
  .desk-folders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .desk-folders a{min-width:0;min-height:44px;overflow-wrap:anywhere;padding:8px 11px;}
  .hero{grid-template-columns:repeat(3,minmax(0,1fr));}
  .hero-main,.portrait,.school,.courses,.job,.project,.skill,.hobby,.stat{min-width:0;max-width:100%;}
  .hero h1{font-size:clamp(31px,9vw,40px);letter-spacing:-.9px;line-height:1.22;word-break:keep-all;overflow-wrap:normal;}
  .hero-main{padding:23px 17px;}
  .role{font-size:17px;line-height:1.5;overflow-wrap:normal;}
  .role-label{margin-right:5px;padding:3px 7px;font-size:12px;white-space:nowrap;}
  .intro{font-size:15px;line-height:1.8;overflow-wrap:anywhere;}
  .hero-cta{align-items:center;gap:9px;flex-wrap:nowrap;}
  .hero-cta .button{min-height:44px;margin-top:15px;max-width:100%;padding:10px 13px;font-size:14px;}
  .tile-play{width:64px;height:64px;margin:8px 3px 0 0;}
  .hero .portrait{min-height:0;transform:none;}
  .hero .portrait-frame{min-height:0;display:grid;place-items:center;padding:12px;}
  .hero .portrait-frame img{width:min(100%,200px);height:auto;max-height:none;aspect-ratio:auto;object-fit:contain;}
  .stat{transform:none!important;padding:10px 7px;}
  .stat strong{font-size:clamp(18px,5.5vw,22px);white-space:nowrap;}
  .stat span{font-size:12px;line-height:1.4;overflow-wrap:anywhere;}
  .section-title{max-width:100%;flex-wrap:wrap;gap:6px 10px;}
  .section-title h2{font-size:23px;line-height:1.3;word-break:keep-all;}
  .section-title span{font-size:14px;}
  .education,.skills-grid,.project-grid,.hobbies-grid{grid-template-columns:minmax(0,1fr);}
  .school{padding:19px 15px;gap:12px;}
  .school>div:nth-child(2){flex:1;min-width:0;}
  .school h3{overflow-wrap:anywhere;}
  .school-icon{flex:0 0 54px;width:54px;height:54px;}
  .school-icon img{width:100%;height:auto;max-height:54px;object-fit:contain;}
  .tags{min-width:0;max-width:100%;flex-wrap:wrap;gap:6px;}
  .tags span{max-width:100%;overflow-wrap:anywhere;font-size:13px;}
  .award-entry{min-height:74px;width:100%;padding:11px 12px;gap:8px;flex-wrap:nowrap;}
  .award-entry-text{min-width:0;}
  .award-entry-text>span{font-size:12px;line-height:1.45;}
  .award-entry-action{font-size:12px;white-space:normal;text-align:center;flex:0 0 68px;}
  .experience-list{padding-left:12px;}
  .job{padding:15px 12px;}
  .job-head{gap:8px;align-items:flex-start;}
  .company-mark{flex:0 0 42px;width:42px;height:42px;font-size:12px;}
  .job-meta h3,.job-roles strong{font-size:15px;line-height:1.45;overflow-wrap:anywhere;}
  .job-meta time{font-size:13px;white-space:nowrap;}
  .toggle{width:44px;height:44px;min-width:44px;min-height:44px;flex:0 0 44px;font-size:20px;touch-action:manipulation;}
  .job-detail li{overflow-wrap:anywhere;}
  .project-grid{padding:17px 12px;gap:22px;border-width:4px;}
  .project,.project:hover{transform:none!important;}
  .project-media{height:205px;max-width:100%;}
  .project-media img{object-fit:contain;}
  .archive-cover-label{left:8px;bottom:8px;right:8px;padding:8px 10px;max-width:100%;}
  .archive-cover-label strong{font-size:18px;line-height:1.3;}
  .henry-artworks{width:85%;gap:6px;}
  .henry-artworks img{object-fit:contain;height:102px;min-width:0;}
  .henry-cover-title strong{font-size:28px;}
  .project-body h3{font-size:19px;overflow-wrap:anywhere;word-break:normal;}
  .project-body{min-width:0;}
  .project-body p{overflow-wrap:anywhere;}
  .project-actions{display:flex;width:100%;flex-wrap:wrap;gap:9px;}
  .project-actions .button,.project-actions .detail-button{flex:1;min-width:110px;}
  .button,.detail-button,.dialog-close{min-height:44px;touch-action:manipulation;}
  .dialog-close{width:44px;min-width:44px;flex:none;line-height:1;}
  .project-dialog{width:calc(100% - 20px);max-width:calc(100% - 20px);max-height:calc(100dvh - 24px);margin:auto;overflow-y:auto;overscroll-behavior:contain;box-shadow:3px 4px #2a445b45,0 14px 36px #263e5650;}
  .project-dialog .dialog-bar{position:sticky;top:0;z-index:5;padding:5px 9px;}
  .dialog-body{padding:14px;min-width:0;}
  .dialog-body h2{font-size:20px;overflow-wrap:anywhere;margin-bottom:12px;}
  #dialog-media{max-width:100%;min-width:0;overflow:auto;overscroll-behavior-inline:contain;touch-action:pan-x pan-y;}
  #dialog-media>img{display:block;width:100%;height:auto;max-height:260px;object-fit:contain;margin-bottom:12px;}
  #dialog-media.project-zoomed>img{width:170%;max-width:none;max-height:none;cursor:zoom-out;}
  .dialog-artworks{display:flex;width:100%;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-inline:contain;touch-action:pan-x pan-y;padding-bottom:8px;scrollbar-width:thin;}
  .dialog-artworks img{flex:0 0 100%;width:100%;min-width:100%;height:220px;max-height:220px;object-fit:contain;scroll-snap-align:start;margin:0;}
  .project-gallery-controls:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 14px;}
  .project-gallery-controls .detail-button{min-width:78px;}
  .project-gallery-controls .detail-button:disabled{opacity:.4;}
  .project-gallery-controls .detail-button:disabled:active{filter:none;}
  .project-gallery-controls span{font-size:13px;white-space:nowrap;}
  .project-image-zoom:not([hidden]){display:block;margin:0 0 14px;}
  #dialog-link .button{width:100%;min-height:46px;}
  .award-window-content{max-height:calc(100dvh - 82px);padding:10px;overflow:auto;overscroll-behavior:contain;}
  .award-item{min-width:0;}
  .award-modal-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .award-view{min-width:0;}
  .award-image-scroll{max-height:55dvh;touch-action:pan-x pan-y;}
  .award-image-scroll img{max-height:54dvh;width:auto;height:auto;}
  .award-controls{gap:7px;}
  .award-controls .detail-button{min-width:78px;}
  .footer{gap:12px;align-items:center;}
  .footer>div{min-width:0;}
  .footer .button{min-height:44px;}
  .photo-welcome-actions{width:max-content;max-width:calc(100% - 24px);white-space:normal;gap:8px;}
  .photo-welcome-actions span{min-width:0;}
  .photo-welcome-actions button{min-height:44px;min-width:68px;flex:none;font-size:13px;}
  .project-view,.award-dialog{scrollbar-gutter:auto;}
}
@media(max-width:680px) and (hover:none){
  .card:hover,.project:hover,.desk-folders a:hover,.award-item:hover{transform:none;translate:none;}
  .button:hover,.contact:hover{transform:none;}
  .card:active,.desk-folders a:active,.award-entry:active,.detail-button:active,.button:active{filter:brightness(.97);}
  .award-entry:active::after{width:33px;height:33px;}
  .tile-play:active .tile{scale:.85;border-radius:50%;}
}
