/* Mobile polish, V11: added after the approved theme styles; no palette/font changes. */
:root { --ph-safe-inline: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
html { max-width:100%; overflow-x:clip; }
body { max-width:100%; overflow-x:clip; }
main, section, .container, .hero__inner, .about__grid, .footer__inner { min-width:0; }
.ph-asterisk { width:1em; height:1em; display:block; stroke:currentColor; flex:none; }
.hero__cross .ph-asterisk, .story__star .ph-asterisk { width:28px; height:28px; }
.ph-asterisk-holder { display:inline-grid; place-items:center; font-size:11px; color:var(--wine); }
.ph-asterisk-holder .ph-asterisk {width:11px;height:11px;}
.ph-text-arrow { font-family:Arial, sans-serif; font-variant-emoji:text; }
img,svg,video,canvas,iframe { max-width:100%; }
/* Internal demos and horizontally moving tracks are explicitly exempted. */
.discipline-strip__track,.discipline-strip__track svg,.v9-scaled-viewport iframe { max-width:none; }
@media (max-width:900px) {
  .site-header { padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px); }
  .nav { min-width:0; gap:9px; }
  .brand { min-width:0; gap:8px; }
  .brand__name { min-width:0; max-width:calc(100vw - 175px); overflow:hidden; font-size:clamp(9px,2.4vw,14px); }
  .nav-actions { gap:7px; flex:none; }
  .nav-cta { display:none; }
  .nav-links { width:100%; max-height:calc(100dvh - var(--nav-height) - env(safe-area-inset-top,0px)); overflow-y:auto; -webkit-overflow-scrolling:touch; }
  .menu-toggle { min-width:44px;min-height:44px; }
  .hero { min-height:100svh; min-height:100dvh; }
  .section-title, .hero h1, .story__chapter h2 { overflow-wrap:normal; }
  .hero__inner, .about__grid { max-width:100%; }
  .story__sticky { min-height:100svh; }
  .contact-form input,.contact-form textarea { font-size:16px; }
}
@media (max-width:680px) {
  :root { --gutter:clamp(16px,5vw,25px); }
  .hero { padding-inline:max(16px,env(safe-area-inset-left,0px)) max(16px,env(safe-area-inset-right,0px)); min-height:max(630px,100svh); }
  .hero__inner { gap:clamp(16px,5vw,32px); }
  .hero__copy, .hero__art { min-width:0; }
  .hero h1 { font-size:clamp(2.5rem,11.3vw,4.7rem); line-height:1.04; letter-spacing:-.07em; }
  .hero__desc { max-width:35ch; }
  .hero__bottom { gap:12px; padding-bottom:max(17px,env(safe-area-inset-bottom,0px)); }
  .hero__art { max-width:100%; }
  .about__grid, .contact__grid { grid-template-columns:minmax(0,1fr); }
  .skills__grid { grid-template-columns:minmax(0,1fr); }
  .project-card, .project-card__visual { max-width:100%; }
  .detail-container { min-width:0; }
  .detail-navbar { padding-right:max(12px,env(safe-area-inset-right,0px)); }
  .detail-navbar__label { font-size:10px; }
  .footer__inner { flex-wrap:wrap; gap:16px; }
}
@media (max-width:359px) {
  .brand__symbol { font-size:18px; }
  .brand__name { font-size:9px; }
  .hero h1 { font-size:clamp(2.45rem,11vw,2.85rem); }
  .nav { gap:4px; }
  .theme-toggle { min-width:44px; }
  .hero__art { max-width:245px; }
  .hero__coordinate { font-size:8px; }
}
@media (max-height:520px) and (orientation:landscape) and (max-width:950px) {
  .hero { min-height:0; }
  .hero__art { max-height:200px; }
  .nav-links { max-height:calc(100dvh - var(--nav-height)); }
}
@media (hover:none) and (pointer:coarse) {
  .project-card:hover,.skill:hover { transform:none; }
  a,button,[role=button] { -webkit-tap-highlight-color:transparent; }
}
@media (prefers-reduced-motion:reduce) {
  .ph-asterisk,.hero__cross { animation:none!important; }
}
