/* ===== Extra mobile / responsive polish (loaded last) ===== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
img,video,svg,canvas{max-width:100%}
img,video{height:auto}
.ph img{height:100%}
iframe{max-width:100%}
body{overflow-wrap:break-word}

/* Work tabs: smooth swipe scroll instead of getting cut off */
#tabs{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;scrollbar-width:none;overscroll-behavior-x:contain}
#tabs::-webkit-scrollbar{display:none}
#tabs .tab{flex:0 0 auto;scroll-snap-align:start;white-space:nowrap}

/* Comfortable tap targets on touch screens */
@media(hover:none),(max-width:820px){
  .btn,.tab,#theme,.chip{min-height:44px}
  .links a,summary{-webkit-tap-highlight-color:transparent}
}

/* Let grid children shrink instead of forcing the page wider */
.hg>*,.ab>*,.ct>*,.pz>*,.mer>*{min-width:0}
.hero h1{max-width:100%}

/* Tablets */
@media(max-width:1024px){
  .wrap{padding-left:clamp(16px,4vw,48px);padding-right:clamp(16px,4vw,48px)}
}

/* Phones */
@media(max-width:600px){
  body{font-size:1rem}
  section{padding:52px 0}
  .btn{padding:13px 20px}
  .cta .btn{flex:1 1 100%;text-align:center}
  .wk{grid-template-columns:1fr}
  h2{max-width:none}
  .lead{max-width:none}
  table{display:block;overflow-x:auto}
  pre,code{white-space:pre-wrap;word-break:break-word}
}

/* Very small phones (320px) */
@media(max-width:360px){
  .wrap{padding-left:14px;padding-right:14px}
  .job,.apn,.cert{padding-left:14px;padding-right:14px}
  .bd{font-size:.66rem;padding:3px 8px}
}

/* Landscape phones */
@media(max-height:480px) and (orientation:landscape){
  .hero{min-height:0;padding:24px 0}
  section{padding:44px 0}
}

/* Notch / safe areas for fixed UI */
.fab,#tt{bottom:calc(16px + env(safe-area-inset-bottom,0px))}
#lb{padding-left:env(safe-area-inset-left,0);padding-right:env(safe-area-inset-right,0)}
